8000 fix(coverage): exclude node_modules from being covered · xcj-coding/log4js-node@c196c5b · GitHub
[go: up one dir, main page]

Skip to content

Commit c196c5b

Browse files
author
Gareth Jones
committed
fix(coverage): exclude node_modules from being covered
1 parent 1064850 commit c196c5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/sandbox-coverage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const sandbox = require('sandboxed-module');
55
sandbox.configure({
66
sourceTransformers: {
77
nyc: function (source) {
8+
if (this.filename.indexOf('node_modules') > -1) {
9+
return source;
10+
}
811
const nyc = new (require('nyc'))();
912
return nyc.instrumenter().instrumentSync(source, this.filename);
1013
}

0 commit comments

Comments
 (0)
0