diff --git a/exec.js b/exec.js index d1992aa..d5c1ada 100644 --- a/exec.js +++ b/exec.js @@ -70,22 +70,11 @@ if (config.silent) { // Run modified testrpc with large block limit, on (hopefully) unused port. // (Changes here should be also be added to the before() block of test/run.js). if (!config.norpc) { - try { - // NPM installs the testrpc-sc fork at different locations in node_modules based on - // whether testrpc is a pre-existing dependency of the project solcover is being added to - // using (--save-dev). - let command; - if (shell.test('-e', './node_modules/ethereumjs-testrpc-sc')) { - command = './node_modules/ethereumjs-testrpc-sc/bin/testrpc '; - } else { - command = './node_modules/solidity-coverage/node_modules/ethereumjs-testrpc-sc/bin/testrpc '; - } - testrpcProcess = childprocess.exec(command + testrpcOptions); - log(`Testrpc launched on port ${port}`); - } catch (err) { - const msg = `There was a problem launching testrpc: ${err}`; - cleanUp(msg); - } + const command = './node_modules/.bin/testrpc-sc '; + testrpcProcess = childprocess.exec(command + testrpcOptions, null, (err) => { + if (err) cleanUp('testRpc errored after launching as a childprocess.'); + }); + log(`Launching testrpc on port ${port}`); } // Generate a copy of the target truffle project configured for solcover and save to the coverage diff --git a/test/cli.js b/test/cli.js index 4b22b94..aa889ed 100644 --- a/test/cli.js +++ b/test/cli.js @@ -28,7 +28,7 @@ describe('cli', () => { }; before(() => { - const command = `./node_modules/ethereumjs-testrpc-sc/bin/testrpc --gasLimit 0xfffffffffff --port ${port}`; + const command = `./node_modules/.bin/testrpc-sc --gasLimit 0xfffffffffff --port ${port}`; testrpcProcess = childprocess.exec(command); });