File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 2727
2828const App = require ( './../lib/app' ) ;
2929const req = require ( 'req-cwd' ) ;
30+ const death = require ( 'death' ) ;
3031const path = require ( 'path' ) ;
3132const dir = require ( 'node-dir' ) ;
3233const Web3 = require ( 'web3' ) ;
@@ -50,6 +51,7 @@ async function plugin(truffleConfig){
5051
5152 // Start
5253 app = new App ( coverageConfig ) ;
54+ death ( app . cleanUp ) ;
5355
5456 // Write instrumented sources to temp folder
5557 app . instrument ( ) ;
@@ -72,12 +74,18 @@ async function plugin(truffleConfig){
7274 const provider = await app . provider ( ganache ) ;
7375 const accounts = await ( new Web3 ( provider ) ) . eth . getAccounts ( ) ;
7476
75- truffleConfig . provider = provider ;
7677 truffleConfig . network = networkName ;
77- truffleConfig . network_id = "*" ;
78+
79+ // Truffle alternately complains that fields are and
80+ // are not manually set
81+ try {
82+ truffleConfig . network_id = "*" ;
83+ truffleConfig . provider = provider ;
84+ } catch ( err ) { }
85+
7886 truffleConfig . networks [ networkName ] = {
79- network_id : truffleConfig . network_id ,
80- provider : truffleConfig . provider ,
87+ network_id : "*" ,
88+ provider : provider ,
8189 gas : app . gasLimit ,
8290 gasPrice : app . gasPrice ,
8391 from : accounts [ 0 ]
You can’t perform that action at this time.
0 commit comments