Przeglądaj źródła

fix: add pre and post hooks for coverage script

Paul Razvan Berg 5 lat temu
rodzic
commit
84e3ec294c
3 zmienionych plików z 10 dodań i 1 usunięć
  1. 8 0
      .solcover.js
  2. 1 0
      package.json
  3. 1 1
      yarn.lock

+ 8 - 0
.solcover.js

@@ -1,7 +1,15 @@
+const shell = require("shelljs");
+
 module.exports = {
   istanbulReporter: ["html"],
   mocha: {
     delay: true,
   },
+  onCompileComplete: async function (_config) {
+    await run("typechain");
+  },
+  onIstanbulComplete: async function (_config) {
+    shell.rm("-rf", "./typechain");
+  },
   skipFiles: ["mocks", "test"],
 };

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "mocha": "^8.0.1",
     "prettier": "^2.0.5",
     "prettier-plugin-solidity": "^1.0.0-alpha.54",
+    "shelljs": "^0.8.4",
     "shx": "^0.3.2",
     "solc": "0.6.10",
     "solhint": "^3.0.0",

+ 1 - 1
yarn.lock

@@ -9157,7 +9157,7 @@ shebang-regex@^3.0.0:
   resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
   integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
 
-shelljs@^0.8.1, shelljs@^0.8.3:
+shelljs@^0.8.1, shelljs@^0.8.3, shelljs@^0.8.4:
   version "0.8.4"
   resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
   integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==