@@ -52,7 +52,6 @@ var binPath = path.join(__dirname, 'node_modules', '.bin');
5252var makeOptionsPath = path . join ( __dirname , 'make-options.json' ) ;
5353var gendocsPath = path . join ( __dirname , '_gendocs' ) ;
5454var packagePath = path . join ( __dirname , '_package' ) ;
55- var coverageTasksPath = path . join ( buildPath , 'coverage' ) ;
5655
5756var CLI = { } ;
5857
@@ -337,7 +336,7 @@ CLI.test = function(/** @type {{ suite: string; node: string; task: string }} */
337336 console . log ( '> copying ps test lib resources' ) ;
338337 mkdir ( '-p' , path . join ( buildTestsPath , 'lib' ) ) ;
339338 matchCopy ( path . join ( '**' , '@(*.ps1|*.psm1)' ) , path . join ( testsPath , 'lib' ) , path . join ( buildTestsPath , 'lib' ) ) ;
340- cd ( '..' ) ;
339+
341340 var suiteType = argv . suite || 'L0' ;
342341 function runTaskTests ( taskName ) {
343342 banner ( 'Testing: ' + taskName ) ;
@@ -360,21 +359,15 @@ CLI.test = function(/** @type {{ suite: string; node: string; task: string }} */
360359 return ;
361360 }
362361
363- nodeVersions . forEach ( function ( nodeVersion , index ) {
362+ nodeVersions . forEach ( function ( nodeVersion ) {
364363 try {
365364
366365 nodeVersion = String ( nodeVersion ) ;
367366 banner ( 'Run Mocha Suits for node ' + nodeVersion ) ;
368367 // setup the version of node to run the tests
369368 util . installNode ( nodeVersion ) ;
370-
371- if ( nodeVersions . length - 1 === index ) {
372- run ( 'nyc --report-dir ' + coverageTasksPath + ' mocha ' + testsSpec . join ( ' ' ) , /*inheritStreams:*/ true ) ;
373- renameCodeCoverageOutput ( coverageTasksPath , taskName ) ;
374- }
375- else {
376- run ( 'mocha ' + testsSpec . join ( ' ' ) , /*inheritStreams:*/ true ) ;
377- }
369+
370+ run ( 'mocha ' + testsSpec . join ( ' ' ) , /*inheritStreams:*/ true ) ;
378371 } catch ( e ) {
379372 console . error ( e ) ;
380373 process . exit ( 1 ) ;
@@ -393,16 +386,6 @@ CLI.test = function(/** @type {{ suite: string; node: string; task: string }} */
393386 }
394387 } ) ;
395388
396- try {
397- util . rm ( path . join ( coverageTasksPath , '*coverage-summary.json' ) ) ;
398- util . run ( `nyc merge ${ coverageTasksPath } ${ path . join ( coverageTasksPath , 'mergedcoverage.json' ) } ` , true ) ;
399- util . rm ( path . join ( coverageTasksPath , '*-coverage.json' ) ) ;
400- util . run ( `nyc report -t ${ coverageTasksPath } --report-dir ${ coverageTasksPath } --reporter=cobertura` , true ) ;
401- util . rm ( path . join ( coverageTasksPath , 'mergedcoverage.json' ) ) ;
402- } catch ( e ) {
403- console . log ( 'Error while generating coverage report' )
404- }
405-
406389 banner ( 'Running common library tests' ) ;
407390 var commonLibPattern = path . join ( buildTasksPath , 'Common' , '*' , 'Tests' , suiteType + '.js' ) ;
408391 var specs = [ ] ;
@@ -431,22 +414,6 @@ CLI.test = function(/** @type {{ suite: string; node: string; task: string }} */
431414 }
432415}
433416
434- function renameCodeCoverageOutput ( coveragePath , taskName ) {
435- if ( ! coveragePath ) return ;
436- try {
437- if ( fs . existsSync ( coveragePath ) ) {
438- if ( fs . existsSync ( path . join ( coveragePath , "coverage-final.json" ) ) ) {
439- fs . renameSync ( path . join ( coveragePath , "coverage-final.json" ) , path . join ( coveragePath , `${ taskName } -coverage.json` ) ) ;
440- }
441- if ( fs . existsSync ( path . join ( coveragePath , "coverage-summary.json" ) ) ) {
442- fs . renameSync ( path . join ( coveragePath , "coverage-summary.json" ) , path . join ( coveragePath , `${ taskName } -coverage-summary.json` ) ) ;
443- }
444- }
445- } catch ( e ) {
446- console . log ( e )
447- }
448- }
449-
450417//
451418// node make.js testLegacy
452419// node make.js testLegacy --suite L0/XCode
0 commit comments