I am trying to get a solidity test coverage for my contracts. I tried solidity-coverage but I get an assembly invalid opcode error. I tried OpenZeppelin runCoverage and I get out of gas for all the tests.
Environment
Truffle v5.1.54 (core: 5.1.54)
Solidity - 0.6.6 (solc-js)
Node v10.23.0
Web3.js v1.2.9
Details
Here is test-environment-config.js:
module.exports = {
accounts: {
ether: 1e6,
},
contracts: {
type: 'truffle',
defaultGas: 8e7
}
};
here is coverage.js
#!/usr/bin/env node
const { runCoverage } = require('@openzeppelin/test-environment');
async function main () {
await runCoverage(
['mock'],
'npm run compile',
'./node_modules/.bin/mocha --exit --timeout 10000'.split(' '),
);
}
main().catch(e => {
console.error(e);
process.exit(1);
});
All of my tests output the following:
7) UniswapIncentive
"before each" hook for "reverts":
Error: Returned error: VM Exception while processing transaction: out of gas
at Context.<anonymous> (test/UniswapIncentive.test.js:19:31)
Code to reproduce