diff --git a/.gitignore b/.gitignore index 97b040664..fcf8f4012 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ node_modules/ build/ .DS_Store/ +/coverage +coverage.json \ No newline at end of file diff --git a/package.json b/package.json index 681a5d499..de348489d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "test": "scripts/test.sh", "console": "truffle console", - "install": "scripts/install.sh" + "install": "scripts/install.sh", + "coverage": "scripts/coverage.sh" }, "repository": { "type": "git", @@ -35,6 +36,7 @@ "babel-preset-stage-3": "^6.17.0", "babel-register": "^6.23.0", "ethereumjs-testrpc": "^3.0.2", + "solidity-coverage": "^0.1.0", "truffle": "https://github.com/ConsenSys/truffle.git#3.1.9" } } diff --git a/scripts/coverage.sh b/scripts/coverage.sh new file mode 100755 index 000000000..9257d8a36 --- /dev/null +++ b/scripts/coverage.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +SOLIDITY_COVERAGE=true ./node_modules/.bin/solidity-coverage diff --git a/truffle.js b/truffle.js index d101dc5bf..d33b28990 100644 --- a/truffle.js +++ b/truffle.js @@ -1,10 +1,13 @@ require('babel-register'); require('babel-polyfill'); +var provider; var HDWalletProvider = require('truffle-hdwallet-provider'); - var mnemonic = '[REDACTED]'; -var provider = new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/'); + +if (!process.env.SOLIDITY_COVERAGE){ + provider = new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/') +} module.exports = { @@ -17,6 +20,13 @@ module.exports = { ropsten: { provider: provider, network_id: 3 // official id of the ropsten network + }, + coverage: { + host: "localhost", + network_id: "*", + port: 8555, + gas: 0xfffffffffff, + gasPrice: 0x01 } } };