Add solidity-coverage
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,3 +3,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
build/
|
build/
|
||||||
.DS_Store/
|
.DS_Store/
|
||||||
|
/coverage
|
||||||
|
coverage.json
|
||||||
@ -6,7 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "scripts/test.sh",
|
"test": "scripts/test.sh",
|
||||||
"console": "truffle console",
|
"console": "truffle console",
|
||||||
"install": "scripts/install.sh"
|
"install": "scripts/install.sh",
|
||||||
|
"coverage": "scripts/coverage.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -35,6 +36,7 @@
|
|||||||
"babel-preset-stage-3": "^6.17.0",
|
"babel-preset-stage-3": "^6.17.0",
|
||||||
"babel-register": "^6.23.0",
|
"babel-register": "^6.23.0",
|
||||||
"ethereumjs-testrpc": "^3.0.2",
|
"ethereumjs-testrpc": "^3.0.2",
|
||||||
|
"solidity-coverage": "^0.1.0",
|
||||||
"truffle": "https://github.com/ConsenSys/truffle.git#3.1.9"
|
"truffle": "https://github.com/ConsenSys/truffle.git#3.1.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
scripts/coverage.sh
Executable file
3
scripts/coverage.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
SOLIDITY_COVERAGE=true ./node_modules/.bin/solidity-coverage
|
||||||
14
truffle.js
14
truffle.js
@ -1,10 +1,13 @@
|
|||||||
require('babel-register');
|
require('babel-register');
|
||||||
require('babel-polyfill');
|
require('babel-polyfill');
|
||||||
|
|
||||||
|
var provider;
|
||||||
var HDWalletProvider = require('truffle-hdwallet-provider');
|
var HDWalletProvider = require('truffle-hdwallet-provider');
|
||||||
|
|
||||||
var mnemonic = '[REDACTED]';
|
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 = {
|
module.exports = {
|
||||||
@ -17,6 +20,13 @@ module.exports = {
|
|||||||
ropsten: {
|
ropsten: {
|
||||||
provider: provider,
|
provider: provider,
|
||||||
network_id: 3 // official id of the ropsten network
|
network_id: 3 // official id of the ropsten network
|
||||||
|
},
|
||||||
|
coverage: {
|
||||||
|
host: "localhost",
|
||||||
|
network_id: "*",
|
||||||
|
port: 8555,
|
||||||
|
gas: 0xfffffffffff,
|
||||||
|
gasPrice: 0x01
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user