Skip to content

Commit

Permalink
fix(node): exclude test patterns in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffeastrom committed Mar 18, 2019
1 parent f976e15 commit 306e45d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commands/node/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class Runner extends EventEmitter {
this.logLine('Loading', file);
});
this.nyc = new NYC(this.argv.nyc);
this.argv.shouldInstrument = f => this.nyc.exclude.shouldInstrument(f);
this.argv.shouldInstrument = f => !utils.isTestFile(f, this.argv) && this.nyc.exclude.shouldInstrument(f);
try {
this.deleteCoverage()
.setup(testFiles, srcFiles)
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const DEFAULT_TRANSFORM_EXCLUDE_PATTERN = [
'**/*require*.js',
'**/*sinon*.js',
'**/*chai*.js',
DEFAULT_TEST_EXT_PATTERN,
DEFAULT_TEST_GLOB_PATTERN,
];
const DEFAULT_INSTRUMENT_EXCLUDE_PATTERN = DEFAULT_TRANSFORM_EXCLUDE_PATTERN;

Expand Down

0 comments on commit 306e45d

Please sign in to comment.