Skip to content

Commit 0fc217e

Browse files
committed
feat: Add test-exclude args to check-coverage and report subcommands.
1 parent 36bcc0b commit 0fc217e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

lib/commands/check-coverage.js

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const testExclude = require('test-exclude')
12
const NYC = require('../../index.js')
23

34
exports.command = 'check-coverage'
@@ -6,6 +7,24 @@ exports.describe = 'check whether coverage is within thresholds provided'
67

78
exports.builder = function (yargs) {
89
yargs
10+
.option('exclude', {
11+
alias: 'x',
12+
default: testExclude.defaultExclude,
13+
describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded',
14+
global: false
15+
})
16+
.option('exclude-after-remap', {
17+
default: true,
18+
type: 'boolean',
19+
description: 'should exclude logic be performed after the source-map remaps filenames?',
20+
global: false
21+
})
22+
.option('include', {
23+
alias: 'n',
24+
default: [],
25+
describe: 'a list of specific files that should be covered, glob patterns are supported',
26+
global: false
27+
})
928
.option('branches', {
1029
default: 0,
1130
description: 'what % of branches must be covered?'

lib/commands/report.js

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const testExclude = require('test-exclude')
12
const NYC = require('../../index.js')
23

34
exports.command = 'report'
@@ -23,6 +24,24 @@ exports.builder = function (yargs) {
2324
.option('temp-directory', {
2425
hidden: true
2526
})
27+
.option('exclude', {
28+
alias: 'x',
29+
default: testExclude.defaultExclude,
30+
describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded',
31+
global: false
32+
})
33+
.option('exclude-after-remap', {
34+
default: true,
35+
type: 'boolean',
36+
description: 'should exclude logic be performed after the source-map remaps filenames?',
37+
global: false
38+
})
39+
.option('include', {
40+
alias: 'n',
41+
default: [],
42+
describe: 'a list of specific files that should be covered, glob patterns are supported',
43+
global: false
44+
})
2645
.option('show-process-tree', {
2746
describe: 'display the tree of spawned processes',
2847
default: false,

0 commit comments

Comments
 (0)