Fix coverage analysis (#4648)

(cherry picked from commit 2c6b859dd0)
This commit is contained in:
Francisco
2023-10-03 17:43:12 -03:00
committed by Francisco Giordano
parent d6954f17b5
commit 21ef8130c8
2 changed files with 5 additions and 1 deletions

View File

@ -61,6 +61,10 @@ require('hardhat-exposed');
require('solidity-docgen'); require('solidity-docgen');
argv.foundry && require('@nomicfoundation/hardhat-foundry'); argv.foundry && require('@nomicfoundation/hardhat-foundry');
if (argv.foundry && argv.coverage) {
throw Error('Coverage analysis is incompatible with Foundry. Disable with `FOUNDRY=false` in the environment');
}
for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) { for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) {
require(path.join(__dirname, 'hardhat', f)); require(path.join(__dirname, 'hardhat', f));
} }

View File

@ -9,7 +9,7 @@
], ],
"scripts": { "scripts": {
"compile": "hardhat compile", "compile": "hardhat compile",
"coverage": "env COVERAGE=true hardhat coverage", "coverage": "env COVERAGE=true FOUNDRY=false hardhat coverage",
"docs": "npm run prepare-docs && oz-docs", "docs": "npm run prepare-docs && oz-docs",
"docs:watch": "oz-docs watch contracts docs/templates docs/config.js", "docs:watch": "oz-docs watch contracts docs/templates docs/config.js",
"prepare-docs": "scripts/prepare-docs.sh", "prepare-docs": "scripts/prepare-docs.sh",