Skip to content

Commit

Permalink
add buidler coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vittominacori committed Jan 18, 2020
1 parent af25d6e commit dc0804e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions buidler.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require('chai/register-should');
usePlugin('solidity-coverage'); // eslint-disable-line no-undef
usePlugin('@nomiclabs/buidler-ganache'); // eslint-disable-line no-undef
usePlugin('@nomiclabs/buidler-truffle5'); // eslint-disable-line no-undef

module.exports = {
Expand All @@ -7,6 +9,11 @@ module.exports = {
buidlerevm: {
hardfork: 'istanbul',
},
coverage: {
url: 'http://127.0.0.1:8555',
gas: 0xfffffffffff,
gasPrice: 0x01,
},
},
solc: {
version: '0.5.16',
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"test": "npm run compile && scripts/test.sh",
"buidler:compile": "buidler compile",
"buidler:console": "buidler console",
"buidler:coverage": "npm run buidler:compile && USE_BUIDLER=true scripts/coverage.sh",
"buidler:test": "buidler test",
"clean": "rm -rf coverage",
"profile": "npm run clean && npm run coverage && open coverage/index.html",
"lint": "npm run lint:js && npm run lint:sol",
"lint:fix": "npm run lint:js:fix",
"lint:js": "eslint .",
Expand Down Expand Up @@ -46,25 +49,26 @@
},
"devDependencies": {
"@nomiclabs/buidler": "^1.0.2",
"@nomiclabs/buidler-ganache": "^1.0.2",
"@nomiclabs/buidler-truffle5": "^1.0.2",
"@nomiclabs/buidler-web3": "^1.0.2",
"@openzeppelin/test-helpers": "^0.5.4",
"chai": "^4.2.0",
"coveralls": "^3.0.9",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-mocha-no-only": "^1.1.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"ethereumjs-util": "^6.2.0",
"ethjs-abi": "^0.2.1",
"ganache-cli": "^6.8.0-istanbul.0",
"ganache-cli": "^6.8.2",
"pify": "^4.0.1",
"solhint": "^2.3.0",
"solidity-coverage": "^0.7.0",
"truffle": "^5.1.6",
"solidity-coverage": "^0.7.1",
"truffle": "^5.1.9",
"vuepress": "^0.14.11",
"web3": "^1.2.4"
}
Expand Down
6 changes: 5 additions & 1 deletion scripts/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

npx truffle run coverage --network coverage
if [ "$USE_BUIDLER" = true ]; then
npx buidler coverage --network coverage
else
npx truffle run coverage --network coverage
fi

cat coverage/lcov.info | coveralls

0 comments on commit dc0804e

Please sign in to comment.