Run solidity-coverage with "@openzeppelin/test-environment"

hi.
i use "@openzeppelin/test-environment" for running my tests fast.
but when i want to run coverage i get zero as results.

this is coverge.js

this is my compile.sh

and this is my package.json
{
"dependencies": {
"@opengsn/cli": "^2.2.2",
"@opengsn/contracts": "^2.2.2",
"@opengsn/provider": "^2.2.2",
"@openzeppelin/contracts": "^4.2.0",
"@openzeppelin/contracts-ethereum-package": "^3.0.0",
"@openzeppelin/contracts-upgradeable": "^4.2.0",
"@truffle/hdwallet-provider": "^1.2.5",
"arb-ethers-web3-bridge": "^0.7.3",
"dotenv": "^8.2.0",
"ethers": "^5.1.0",
"truffle": "^5.4.16"
},
"devDependencies": {
"@codechecks/client": "^0.1.10",
"@openzeppelin/test-environment": "^0.1.9",
"@openzeppelin/test-helpers": "^0.5.11",
"@openzeppelin/truffle-upgrades": "^1.0.1",
"big.js": "^6.1.1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.1.0",
"eth-gas-reporter": "^0.2.22",
"ethereumjs-units": "^0.2.0",
"mocha": "^9.1.3",
"prettier": "^2.2.1",
"prettier-plugin-solidity": "^1.0.0-beta.2",
"solidity-coverage": "^0.7.16",
"truffle-assertions": "^0.9.2"
},
"scripts": {
"test": "mocha --exit --recursive --timeout 0",
"ganache": "node_modules/.bin/ganache-cli --networkId 1337 --chainId 1337 -l 20000000",
"gsn": "node_modules/.bin/gsn start",
"compile": "scripts/compile.sh",
"coverage": "scripts/coverage.js"
},
"keywords": [
"SmartContract",
"Solidity",
"Token",
"ERC721",
"ERC20"
],
}

1 Like

OpenZeppelin Test Environment is no longer maintained. We encourage you to use Hardhat or Truffle which will run more smoothly when setting up coverage. Apologies!