@@ -94,12 +94,13 @@ class App {
9494 } ) ;
9595 }
9696
97- // Load config if present, accomodate common windows naming.
97+ // Load config
9898 let truffleConfig ;
99+ let oldTrufflePath = `${ this . workingDir } /truffle.js` ;
100+ let newTrufflePath = `${ this . workingDir } /truffle-config.js` ;
99101
100- shell . test ( '-e' , `${ this . workingDir } /truffle.js` )
101- ? truffleConfig = reqCwd . silent ( `${ this . workingDir } /truffle.js` )
102- : truffleConfig = reqCwd . silent ( `${ this . workingDir } /truffle-config.js` ) ;
102+ if ( shell . test ( '-e' , oldTrufflePath ) ) truffleConfig = reqCwd . silent ( oldTrufflePath ) ;
103+ else if ( shell . test ( '-e' , newTrufflePath ) ) truffleConfig = reqCwd . silent ( newTrufflePath ) ;
103104
104105 // Coverage network opts specified: use port if declared
105106 if ( truffleConfig && truffleConfig . networks && truffleConfig . networks . coverage ) {
@@ -109,10 +110,7 @@ class App {
109110 // No coverage network defaults to the dev network on port 8555, high gas / low price.
110111 } else {
111112 const trufflejs = defaultTruffleConfig ( this . port , gasLimitHex , gasPriceHex ) ;
112-
113- ( process . platform === 'win32' )
114- ? fs . writeFileSync ( `${ this . coverageDir } /truffle-config.js` , trufflejs )
115- : fs . writeFileSync ( `${ this . coverageDir } /truffle.js` , trufflejs ) ;
113+ fs . writeFileSync ( `${ this . coverageDir } /truffle-config.js` , trufflejs ) ;
116114 }
117115
118116 // Compile the contracts before instrumentation and preserve their ABI's.
@@ -272,7 +270,7 @@ class App {
272270 const defaultCommand = `truffle compile ${ this . network } ${ this . silence } ` ;
273271 const command = this . compileCommand || defaultCommand ;
274272 this . log ( `Running: ${ command } \n(this can take a few seconds)...` ) ;
275-
273+
276274 shell . cd ( this . coverageDir ) ;
277275 shell . exec ( command ) ;
278276 this . testsErrored = shell . error ( ) ;
0 commit comments