@@ -73,30 +73,23 @@ if (config.silent) {
7373// environment folder.
7474log ( 'Generating coverage environment' ) ;
7575try {
76- // Truffle environment:
77- // contracts/
78- // test/
79- // migrations/
80- // truffle.js
81-
82- let files = shell . ls ( `${ workingDir } ` ) ;
76+ let files = shell . ls ( workingDir ) ;
8377 const nmIndex = files . indexOf ( 'node_modules' ) ;
8478
8579 if ( ! config . copyNodeModules && nmIndex > - 1 ) {
8680 files . splice ( nmIndex , 1 ) ; // Removes node_modules from array.
8781 }
8882
8983 files = files . map ( file => `${ workingDir } /` + file ) ;
90- shell . mkdir ( ` ${ coverageDir } ` ) ;
91- shell . cp ( '-R' , files , ` ${ coverageDir } ` ) ;
84+ shell . mkdir ( coverageDir ) ;
85+ shell . cp ( '-R' , files , coverageDir ) ;
9286
9387 const truffleConfig = reqCwd . silent ( `${ workingDir } /truffle.js` ) ;
9488
95- // Coverage network opts specified: copy truffle.js whole to coverage environment
89+ // Coverage network opts specified: use port if declared
9690 if ( truffleConfig && truffleConfig . networks && truffleConfig . networks . coverage ) {
9791 port = truffleConfig . networks . coverage . port || port ;
98- shell . cp ( `${ workingDir } /truffle.js` , `${ coverageDir } /truffle.js` ) ;
99-
92+
10093 // Coverage network opts NOT specified: default to the development network w/ modified
10194 // port, gasLimit, gasPrice. Export the config object only.
10295 } else {
@@ -203,9 +196,7 @@ try {
203196 istanbulReporter . add ( 'html' ) ;
204197 istanbulReporter . add ( 'lcov' ) ;
205198 istanbulReporter . add ( 'text' ) ;
206- istanbulReporter . write ( istanbulCollector , true , ( ) => {
207- log ( 'Istanbul coverage reports generated' ) ;
208- } ) ;
199+ istanbulReporter . write ( istanbulCollector , true ) ;
209200} catch ( err ) {
210201 if ( config . testing ) {
211202 cleanUp ( ) ;
0 commit comments