Merge pull request #5 from sc-forks/testrpc-fixes

Use node_modules/.bin/testrpc-sc
pull/6/head
c-g-e-w-e-k-e- 8 years ago committed by GitHub
commit 87d1282482
  1. 21
      exec.js
  2. 2
      test/cli.js

@ -70,22 +70,11 @@ if (config.silent) {
// Run modified testrpc with large block limit, on (hopefully) unused port. // 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). // (Changes here should be also be added to the before() block of test/run.js).
if (!config.norpc) { if (!config.norpc) {
try { const command = './node_modules/.bin/testrpc-sc ';
// NPM installs the testrpc-sc fork at different locations in node_modules based on testrpcProcess = childprocess.exec(command + testrpcOptions, null, (err) => {
// whether testrpc is a pre-existing dependency of the project solcover is being added to if (err) cleanUp('testRpc errored after launching as a childprocess.');
// using (--save-dev). });
let command; log(`Launching testrpc on port ${port}`);
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);
}
} }
// Generate a copy of the target truffle project configured for solcover and save to the coverage // Generate a copy of the target truffle project configured for solcover and save to the coverage

@ -28,7 +28,7 @@ describe('cli', () => {
}; };
before(() => { 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); testrpcProcess = childprocess.exec(command);
}); });

Loading…
Cancel
Save