Skip to content

Commit

Permalink
migrate to solidity-coverage - pending sc-forks/solidity-coverage#541
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaschuk committed Nov 17, 2020
1 parent 4fcc988 commit ca3cd95
Show file tree
Hide file tree
Showing 5 changed files with 763 additions and 30 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ jobs:
- v1-dependencies
- run: yarn compile
- run: yarn test
coverage:
docker:
- image: circleci/node:14.6
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies
- run: yarn coverage
- store_artifacts:
path: coverage
benchmark:
docker:
- image: circleci/node:14.6
Expand All @@ -56,6 +68,10 @@ workflows:
- test:
requires:
- build
- coverage:
requires:
- build
- test # only run if tests pass, redundantly runs tests
- benchmark:
requires:
- build
5 changes: 5 additions & 0 deletions .solcover.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
skipFiles: [
'test', // don't report coverage for contracts in test directory
],
};
2 changes: 2 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { HardhatUserConfig } from 'hardhat/config';

import '@nomiclabs/hardhat-waffle';

import 'solidity-coverage';

const config: HardhatUserConfig = {
networks: {
hardhat: {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint:solidity": "solhint 'contracts/**/*.sol'",
"lint:typescript": "eslint . --ext .ts",
"test": "hardhat test --no-compile",
"test:watch": "nodemon --ext js,ts --watch test --watch scripts --watch cache/solidity-files-cache.json --exec 'clear && yarn test'"
"test:watch": "nodemon --ext js,ts --watch test --watch scripts --watch cache/solidity-files-cache.json --exec 'clear && yarn test'",
"coverage": "hardhat coverage"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.0",
Expand All @@ -38,6 +39,7 @@
"prettier-plugin-solidity": "^1.0.0-alpha.59",
"solhint": "^3.2.0",
"solhint-plugin-prettier": "^0.0.4",
"solidity-coverage": "^0.7.12",
"ts-node": "^8.10.2",
"typescript": "^4.0.2"
}
Expand Down
Loading

0 comments on commit ca3cd95

Please sign in to comment.