Skip to content

Commit

Permalink
Merge pull request #45 from cgewecke/add-coverage
Browse files Browse the repository at this point in the history
Add working coverage command
  • Loading branch information
0age authored Mar 20, 2020
2 parents 9d15018 + f9d437b commit 2d39e34
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const package = require("./package.json");
const shell = require("shelljs");
const utils = require("solidity-coverage/plugins/resources/truffle.utils");

module.exports = {
port: 8545,
skipFiles: ["mcd", "interfaces"],
client: require("ganache-cli"),
providerOptions: {
network_id: package.config.ganacheNetworkID,
default_balance_ether: package.config.etherBalance,
mnemonic: package.config.mnemonic
},
onServerReady: function() {
shell.exec("rm -rf build");
},
onCompileComplete: async function(config) {
shell.exec("yarn gen:contract-typings");
shell.exec("tsc -b");

// Work arounds
config.test_files = await utils.getTestFilePaths(config);
process.env.npm_package_config_mnemonic = package.config.mnemonic;
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"gen:contract-typings": "rm -f typings/contracts/* && typechain --target ethers --outDir typings/contracts './build/contracts/*.json'",
"start": "./node_modules/.bin/ganache-cli --gasLimit 10000000 -e 10000 2>&1 > ganache-output.log & echo 'local chain started.'",
"test": "tsc -b && truffle test --network ganache build/*.spec.js",
"coverage": "truffle run coverage --temp build --file='./build/*.spec.js'",
"stop": "kill -9 \"$(ps -ax | grep -m1 '[n]ode ./node_modules/.bin/ganache-cli' | awk '{print $1;}')\" && echo 'local chain stopped.'",
"prettier": "prettier --write"
},
Expand Down

0 comments on commit 2d39e34

Please sign in to comment.