-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
.nycrc.js
50 lines (47 loc) · 1.21 KB
/
.nycrc.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
const TEST_TYPE = ((argv) => {
let match = argv[argv.length - 1].match(/npm\/test-(\w+).js/);
return match && match[1] || '';
})(process.argv);
function configOverrides (testType) {
switch (testType) {
case 'cli':
return {
statements: 80,
branches: 65,
functions: 85,
lines: 80
};
case 'integration':
return {
statements: 40,
branches: 20,
functions: 40,
lines: 40
};
case 'library':
return {
statements: 55,
branches: 40,
functions: 55,
lines: 55
};
case 'unit':
return {
statements: 70,
branches: 55,
functions: 80,
lines: 70
};
default:
return {}
}
}
module.exports = {
all: true,
'check-coverage': true,
'report-dir': '.coverage',
'temp-dir': '.nyc_output',
include: ['lib/**/*.js', 'bin/**/*.js'],
reporter: ['lcov', 'json', 'text', 'text-summary'],
...configOverrides(TEST_TYPE),
};