This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnyc.config.js
94 lines (85 loc) · 1.76 KB
/
nyc.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Check out nyc at: https://istanbul.js.org/
import process from "node:process";
import values from "./.values.cjs";
const {
dependenciesDir,
compiledDir,
packagesCoverageExclusions,
packagesDir,
packagesExpr,
packagesList,
reportsDir,
tempDir,
testDirCommon,
testsDir,
testSuffix,
testTypeEndToEnd,
testTypeIntegration,
testTypeUnit,
} = values;
const reportIdentifier = packagesList.length > 1 ? "_mixed" : packagesList[0];
let testTypeCoverageExclusions;
switch (process.env.TEST_TYPE) {
case testTypeEndToEnd:
testTypeCoverageExclusions = [
`${packagesDir}/**/__tests__/`,
];
break;
case testTypeIntegration:
testTypeCoverageExclusions = [
`${packagesDir}/**/__tests__/`,
];
break;
case testTypeUnit:
testTypeCoverageExclusions = [
`${packagesDir}/**/index.ts`,
];
break;
default:
testTypeCoverageExclusions = [];
}
export default {
all: true,
extends: [
"@istanbuljs/nyc-config-typescript",
],
reporter: [
"lcov",
"text",
],
checkCoverage: true,
statements: 90,
lines: 90,
branches: 90,
functions: 90,
watermarks: {
statements: [85, 95],
lines: [85, 95],
branches: [85, 95],
functions: [85, 95],
},
extensions: [
".ts",
],
include: [
`${packagesDir}/${packagesExpr}/**/*.ts`,
],
exclude: [
`${reportsDir}/`,
`${tempDir}/`,
`${dependenciesDir}/`,
`${packagesDir}/**/*.${testSuffix}.ts`,
`${packagesDir}/**/${testsDir}/${testDirCommon}/index.ts`,
`${packagesDir}/**/${compiledDir}/`,
...packagesCoverageExclusions,
...testTypeCoverageExclusions,
],
reportDir: [
".",
reportsDir,
"coverage",
process.env.TEST_TYPE,
reportIdentifier,
].join("/"),
tempDir: `./${tempDir}/nyc/${reportIdentifier}`,
};