forked from postmanlabs/newman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.nycrc.js
50 lines (47 loc) · 1.22 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: 35,
branches: 20,
functions: 35,
lines: 35
};
case 'library':
return {
statements: 55,
branches: 40,
functions: 55,
lines: 55
};
case 'unit':
return {
statements: 70,
branches: 55,
functions: 75,
lines: 75
};
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),
};