File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 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') {
3838 else config . instrumenter = './lib/instrumenters/istanbul'
3939
4040 var nyc = ( new NYC ( config ) )
41- nyc . reset ( )
42-
41+ if ( config . clean ) nyc . reset ( )
4342 if ( config . all ) nyc . addAllFiles ( )
4443
4544 var env = {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ Config.buildYargs = function (cwd) {
6464 default : 'coverage'
6565 } )
6666 . option ( 'temp-directory' , {
67- describe : 'directory from which coverage JSON files are read ' ,
67+ describe : 'directory to read raw coverage information from ' ,
6868 default : './.nyc_output'
6969 } )
7070 . option ( 'show-process-tree' , {
@@ -219,6 +219,17 @@ Config.buildYargs = function (cwd) {
219219 type : 'boolean' ,
220220 global : false
221221 } )
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+ } )
222233 . pkgConf ( 'nyc' , cwd || process . cwd ( ) )
223234 . example ( '$0 npm test' , 'instrument your tests with coverage' )
224235 . 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 1111 "build" : " node ./build-tests" ,
1212 "instrument" : " node ./build-self-coverage.js" ,
1313 "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" ,
1515 "report" : " node ./bin/nyc --temp-directory ./.self_coverage/ -r text -r lcov report" ,
1616 "release" : " standard-version"
1717 },
You can’t perform that action at this time.
0 commit comments