This repository has the test setup used for unit testing on Openzeppelin implementation. It is supposed to test ERC20 behaviours and the implementation itself (buggy or not).
For this test setup, following are the modules being used and its versions.
⚠️ oz/test-environment does not support solidity-coverage yet. Using it will produce wrong coverage data!
- openzeppelin/contracts@v2.5.0
openzeppelin/test-environment@0.1.4- openzeppelin/test-helpers@0.5.5
- mocha@7.1.1
- chai@4.2.0
setup_env script will create a truffle project, a npm package to accomodate and install locally the above modules.
Edit package.json
"scripts": {
- "test": "npx truffle test"
+ "test": "npx mocha --exit --recursive"
}
Edit truffle-config.js
/ package.json
mocha: {
// timeout: 100000
},
+ plugins: ["solidity-coverage"],
Some commands commonly used.
npx truffle run coverage
npm test
npm truffle compile