Browse Source

Fix coverage analysis (#4648)

(cherry picked from commit 2c6b859dd02f872959cff58d89c979c363778cce)
Francisco 2 năm trước cách đây
mục cha
commit
21ef8130c8
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 4 0
      hardhat.config.js
  2. 1 1
      package.json

+ 4 - 0
hardhat.config.js

@@ -61,6 +61,10 @@ require('hardhat-exposed');
 require('solidity-docgen');
 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'))) {
   require(path.join(__dirname, 'hardhat', f));
 }

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
   ],
   "scripts": {
     "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:watch": "oz-docs watch contracts docs/templates docs/config.js",
     "prepare-docs": "scripts/prepare-docs.sh",