File tree 3 files changed +14
-4
lines changed
3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ if (argv._[0] === 'report') {
38
38
else config . instrumenter = './lib/instrumenters/istanbul'
39
39
40
40
var nyc = ( new NYC ( config ) )
41
- nyc . reset ( )
42
-
41
+ if ( config . clean ) nyc . reset ( )
43
42
if ( config . all ) nyc . addAllFiles ( )
44
43
45
44
var env = {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ Config.buildYargs = function (cwd) {
64
64
default : 'coverage'
65
65
} )
66
66
. option ( 'temp-directory' , {
67
- describe : 'directory from which coverage JSON files are read ' ,
67
+ describe : 'directory to read raw coverage information from ' ,
68
68
default : './.nyc_output'
69
69
} )
70
70
. option ( 'show-process-tree' , {
@@ -219,6 +219,17 @@ Config.buildYargs = function (cwd) {
219
219
type : 'boolean' ,
220
220
global : false
221
221
} )
222
+ . option ( 'clean' , {
223
+ describe : 'should the .nyc_output folder be cleaned before executing tests' ,
224
+ default : true ,
225
+ type : 'boolean' ,
226
+ global : false
227
+ } )
228
+ . option ( 'temp-directory' , {
229
+ describe : 'directory to output raw coverage information to' ,
230
+ default : './.nyc_output' ,
231
+ global : false
232
+ } )
222
233
. pkgConf ( 'nyc' , cwd || process . cwd ( ) )
223
234
. example ( '$0 npm test' , 'instrument your tests with coverage' )
224
235
. example ( '$0 --require babel-core/register npm test' , 'instrument your tests with coverage and babel' )
Original file line number Diff line number Diff line change 11
11
"build" : " node ./build-tests" ,
12
12
"instrument" : " node ./build-self-coverage.js" ,
13
13
"test-integration" : " tap -t120 --no-cov -b ./test/build/*.js && mocha --timeout=15000 ./test/src/nyc-bin.js" ,
14
- "test-mocha" : " node ./bin/nyc --silent --temp-directory=./.self_coverage mocha ./test/nyc.js ./test/process-args.js" ,
14
+ "test-mocha" : " node ./bin/nyc --no-clean -- silent --temp-directory=./.self_coverage mocha ./test/nyc.js ./test/process-args.js" ,
15
15
"report" : " node ./bin/nyc --temp-directory ./.self_coverage/ -r text -r lcov report" ,
16
16
"release" : " standard-version"
17
17
},
You can’t perform that action at this time.
0 commit comments