hardhat 3.1.10 → 3.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts +3 -5
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers.js +7 -19
- package/dist/src/internal/builtin-plugins/coverage/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.js +42 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/index.js +1 -0
- package/dist/src/internal/builtin-plugins/coverage/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.d.ts +53 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js +288 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts +0 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js +2 -14
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts +8 -5
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js +20 -18
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.js +42 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js +36 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts +45 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +276 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts +22 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js +88 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js.map +1 -0
- package/dist/src/internal/builtin-plugins/index.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js +17 -20
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.js +2 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.d.ts +0 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.js +0 -6
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts +1 -3
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +0 -49
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-results.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +13 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.d.ts +2 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts +13 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +30 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts +3 -12
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/utils.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/utils.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.d.ts +8 -6
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.js +103 -27
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js +5 -0
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts +3 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js +9 -0
- package/dist/src/internal/builtin-plugins/solidity-test/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +4 -10
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js +0 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js +3 -3
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts +5 -0
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +21 -27
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts +15 -10
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/task-action.js +3 -2
- package/dist/src/internal/builtin-plugins/telemetry/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js +62 -13
- package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts +27 -0
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/cli/banner-manager.d.ts +26 -0
- package/dist/src/internal/cli/banner-manager.d.ts.map +1 -0
- package/dist/src/internal/cli/banner-manager.js +146 -0
- package/dist/src/internal/cli/banner-manager.js.map +1 -0
- package/dist/src/internal/cli/init/init.d.ts.map +1 -1
- package/dist/src/internal/cli/init/init.js +8 -0
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +18 -1
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/subprocess.js +2 -0
- package/dist/src/internal/cli/telemetry/analytics/subprocess.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/anonymize-paths.js +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.d.ts +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.js +47 -38
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.js +1 -1
- package/dist/src/types/artifacts.d.ts +32 -3
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/dist/src/types/network.d.ts +1 -1
- package/dist/src/types/solidity/build-system.d.ts +56 -10
- package/dist/src/types/solidity/build-system.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.js +26 -2
- package/dist/src/types/solidity/build-system.js.map +1 -1
- package/dist/src/types/solidity/resolved-file.d.ts +2 -2
- package/dist/src/types/tasks.d.ts +8 -0
- package/dist/src/types/tasks.d.ts.map +1 -1
- package/dist/src/types/tasks.js.map +1 -1
- package/dist/src/types/test.d.ts +18 -0
- package/dist/src/types/test.d.ts.map +1 -1
- package/dist/src/types/utils.d.ts +16 -0
- package/dist/src/types/utils.d.ts.map +1 -1
- package/dist/src/utils/result.d.ts +33 -0
- package/dist/src/utils/result.d.ts.map +1 -0
- package/dist/src/utils/result.js +43 -0
- package/dist/src/utils/result.js.map +1 -0
- package/package.json +6 -5
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +4 -1
- package/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts +4 -1
- package/src/internal/builtin-plugins/coverage/helpers.ts +11 -29
- package/src/internal/builtin-plugins/coverage/hook-handlers/test.ts +68 -0
- package/src/internal/builtin-plugins/coverage/index.ts +1 -0
- package/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.ts +473 -0
- package/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.ts +3 -17
- package/src/internal/builtin-plugins/gas-analytics/helpers.ts +38 -27
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts +68 -0
- package/src/internal/builtin-plugins/gas-analytics/index.ts +37 -2
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +454 -0
- package/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.ts +172 -0
- package/src/internal/builtin-plugins/index.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +21 -28
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.ts +5 -2
- package/src/internal/builtin-plugins/network-manager/edr/type-validation.ts +0 -13
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +0 -64
- package/src/internal/builtin-plugins/solidity/build-results.ts +3 -1
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +15 -5
- package/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/dependency-graph.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +36 -6
- package/src/internal/builtin-plugins/solidity/build-system/resolver/types.ts +3 -9
- package/src/internal/builtin-plugins/solidity/build-system/resolver/utils.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.ts +125 -28
- package/src/internal/builtin-plugins/solidity/config.ts +2 -2
- package/src/internal/builtin-plugins/solidity/hook-handlers/hre.ts +8 -0
- package/src/internal/builtin-plugins/solidity/tasks/build.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/config.ts +15 -0
- package/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts +2 -2
- package/src/internal/builtin-plugins/solidity-test/helpers.ts +6 -14
- package/src/internal/builtin-plugins/solidity-test/index.ts +0 -1
- package/src/internal/builtin-plugins/solidity-test/runner.ts +3 -3
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +47 -40
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +17 -10
- package/src/internal/builtin-plugins/telemetry/task-action.ts +4 -2
- package/src/internal/builtin-plugins/test/task-action.ts +88 -24
- package/src/internal/builtin-plugins/test/type-extensions.ts +42 -0
- package/src/internal/cli/banner-manager.ts +234 -0
- package/src/internal/cli/init/init.ts +8 -0
- package/src/internal/cli/main.ts +19 -1
- package/src/internal/cli/telemetry/analytics/subprocess.ts +2 -0
- package/src/internal/cli/telemetry/sentry/anonymize-paths.ts +1 -1
- package/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.ts +98 -50
- package/src/internal/core/user-interruptions.ts +1 -1
- package/src/types/artifacts.ts +40 -3
- package/src/types/hre.ts +1 -1
- package/src/types/network.ts +1 -1
- package/src/types/solidity/build-system.ts +75 -14
- package/src/types/solidity/resolved-file.ts +2 -2
- package/src/types/tasks.ts +10 -0
- package/src/types/test.ts +20 -0
- package/src/types/utils.ts +14 -0
- package/src/utils/result.ts +57 -0
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +9 -9
- package/templates/hardhat-3/02-mocha-ethers/package.json +10 -10
- package/templates/hardhat-3/03-minimal/package.json +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.d.ts +0 -19
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.js +0 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.js.map +0 -1
- package/src/internal/builtin-plugins/network-manager/edr/types/output.ts +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAO1D,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAiB,yBAAyB;QACxC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;KAC7B;CACF;AAKD,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAiB,iBAAiB;QAChC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;KAC1B;IAED,UAAiB,aAAa;QAC5B,KAAK,EAAE,cAAc,EAAE,CAAC;KACzB;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAA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AAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE5B;;OAEG;IACH,GAAG,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,SAAS,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAsEA;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;IACrB,qDAA+B,CAAA;AACjC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B"}
|
package/dist/src/types/test.d.ts
CHANGED
|
@@ -2,4 +2,22 @@ export interface HardhatTestUserConfig {
|
|
|
2
2
|
}
|
|
3
3
|
export interface HardhatTestConfig {
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Summary of a test run, containing counts of test outcomes and optional
|
|
7
|
+
* failure output.
|
|
8
|
+
*/
|
|
9
|
+
export interface TestSummary {
|
|
10
|
+
failed: number;
|
|
11
|
+
passed: number;
|
|
12
|
+
skipped: number;
|
|
13
|
+
todo: number;
|
|
14
|
+
failureOutput?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Result of a test run, wrapping a TestSummary. Plugins can extend this
|
|
18
|
+
* interface to include additional data (e.g., suite results).
|
|
19
|
+
*/
|
|
20
|
+
export interface TestRunResult {
|
|
21
|
+
summary: TestSummary;
|
|
22
|
+
}
|
|
5
23
|
//# sourceMappingURL=test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/types/test.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;CAAG;AAIzC,MAAM,WAAW,iBAAiB;CAAG"}
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/types/test.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;CAAG;AAIzC,MAAM,WAAW,iBAAiB;CAAG;AAErC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,WAAW,CAAC;CACtB"}
|
|
@@ -28,4 +28,20 @@ export type Return<T> = T extends (...args: any[]) => infer Ret ? Ret : never;
|
|
|
28
28
|
export type RequireField<T, K extends keyof T> = T & {
|
|
29
29
|
[P in K]-?: T[P];
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* A result that can either have a value or an error.
|
|
33
|
+
*/
|
|
34
|
+
export type Result<ValueT, ErrorT> = {
|
|
35
|
+
readonly success: true;
|
|
36
|
+
readonly value: ValueT;
|
|
37
|
+
} | {
|
|
38
|
+
readonly success: false;
|
|
39
|
+
readonly error: ErrorT;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Returns the keys of T tht don't map to never.
|
|
43
|
+
*/
|
|
44
|
+
export type NonNeverKeys<T> = {
|
|
45
|
+
[K in keyof T]: T[K] extends never ? never : K;
|
|
46
|
+
}[keyof T];
|
|
31
47
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,CAC/C,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,KACvB,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAC9C,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,KACvB,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,CAAC,SAAS,CACtD,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,KAC5B,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CACvC,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,MAAM,IAAI,CAAC,KAC/B,GAAG,GACJ,IAAI,GACJ,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,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I,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAClD,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,IAC7B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,CAAC;CAC/C,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Result } from "../types/utils.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a successful Result with the given value.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to include in the result.
|
|
6
|
+
* @returns A Result with success: true and the given value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function successfulResult<ValueT = undefined>(...args: ValueT extends undefined | void ? [] : [value: ValueT]): {
|
|
9
|
+
success: true;
|
|
10
|
+
value: ValueT;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Creates a failed Result with the given error.
|
|
14
|
+
*
|
|
15
|
+
* @param error The error to include in the result.
|
|
16
|
+
* @returns A Result with success: false and the given error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function errorResult<ErrorT = undefined>(...args: ErrorT extends undefined | void ? [] : [error: ErrorT]): {
|
|
19
|
+
success: false;
|
|
20
|
+
error: ErrorT;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A type guard that checks if a value is a Result.
|
|
24
|
+
*
|
|
25
|
+
* Optionally validates the value and error fields using type guard functions.
|
|
26
|
+
*
|
|
27
|
+
* @param value The value to check.
|
|
28
|
+
* @param isValue Optional type guard for the value field.
|
|
29
|
+
* @param isError Optional type guard for the error field.
|
|
30
|
+
* @returns true if the value is a Result.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isResult<ValueT = unknown, ErrorT = unknown>(value: unknown, isValue?: (v: unknown) => v is ValueT, isError?: (e: unknown) => e is ErrorT): value is Result<ValueT, ErrorT>;
|
|
33
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAG,SAAS,EACjD,GAAG,IAAI,EAAE,MAAM,SAAS,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9D;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAIlC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAG,SAAS,EAC5C,GAAG,IAAI,EAAE,MAAM,SAAS,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9D;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAInC;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EACzD,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,EACrC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,GACpC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUjC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isObject } from "@nomicfoundation/hardhat-utils/lang";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a successful Result with the given value.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to include in the result.
|
|
6
|
+
* @returns A Result with success: true and the given value.
|
|
7
|
+
*/
|
|
8
|
+
export function successfulResult(...args) {
|
|
9
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
10
|
+
-- Cast needed because TS loses the conditional rest parameter context */
|
|
11
|
+
return { success: true, value: args[0] };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a failed Result with the given error.
|
|
15
|
+
*
|
|
16
|
+
* @param error The error to include in the result.
|
|
17
|
+
* @returns A Result with success: false and the given error.
|
|
18
|
+
*/
|
|
19
|
+
export function errorResult(...args) {
|
|
20
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
21
|
+
-- Cast needed because TS loses the conditional rest parameter context */
|
|
22
|
+
return { success: false, error: args[0] };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A type guard that checks if a value is a Result.
|
|
26
|
+
*
|
|
27
|
+
* Optionally validates the value and error fields using type guard functions.
|
|
28
|
+
*
|
|
29
|
+
* @param value The value to check.
|
|
30
|
+
* @param isValue Optional type guard for the value field.
|
|
31
|
+
* @param isError Optional type guard for the error field.
|
|
32
|
+
* @returns true if the value is a Result.
|
|
33
|
+
*/
|
|
34
|
+
export function isResult(value, isValue, isError) {
|
|
35
|
+
if (!isObject(value) || typeof value.success !== "boolean") {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (value.success === true) {
|
|
39
|
+
return "value" in value && (isValue === undefined || isValue(value.value));
|
|
40
|
+
}
|
|
41
|
+
return "error" in value && (isError === undefined || isError(value.error));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/utils/result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAG,IAA4D;IAE/D;6EACyE;IACzE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAW,EAAE,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,GAAG,IAA4D;IAE/D;6EACyE;IACzE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAW,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAc,EACd,OAAqC,EACrC,OAAqC;IAErC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,OAAO,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,OAAO,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hardhat",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.12",
|
|
4
4
|
"description": "Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.",
|
|
5
5
|
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/hardhat",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"./internal/coverage": "./dist/src/internal/builtin-plugins/coverage/exports.js",
|
|
41
41
|
"./internal/gas-analytics": "./dist/src/internal/builtin-plugins/gas-analytics/exports.js",
|
|
42
42
|
"./utils/contract-names": "./dist/src/utils/contract-names.js",
|
|
43
|
+
"./utils/result": "./dist/src/utils/result.js",
|
|
43
44
|
"./types/runtime": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js",
|
|
44
45
|
"./builtin-tasks/task-names": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js",
|
|
45
46
|
"./internal/artifacts": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js"
|
|
@@ -75,11 +76,11 @@
|
|
|
75
76
|
"@nomicfoundation/hardhat-test-utils": "^2.0.2"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@nomicfoundation/edr": "0.12.0-next.
|
|
79
|
-
"@nomicfoundation/hardhat-errors": "^3.0.
|
|
80
|
-
"@nomicfoundation/hardhat-utils": "^4.0.
|
|
79
|
+
"@nomicfoundation/edr": "0.12.0-next.28",
|
|
80
|
+
"@nomicfoundation/hardhat-errors": "^3.0.8",
|
|
81
|
+
"@nomicfoundation/hardhat-utils": "^4.0.1",
|
|
81
82
|
"@nomicfoundation/hardhat-vendored": "^3.0.1",
|
|
82
|
-
"@nomicfoundation/hardhat-zod-utils": "^3.0.
|
|
83
|
+
"@nomicfoundation/hardhat-zod-utils": "^3.0.3",
|
|
83
84
|
"@nomicfoundation/solidity-analyzer": "^0.1.1",
|
|
84
85
|
"@sentry/core": "^9.4.0",
|
|
85
86
|
"adm-zip": "^0.4.16",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ArtifactManager,
|
|
3
3
|
GetArtifactByName,
|
|
4
|
+
StringWithArtifactContractNamesAutocompletion,
|
|
4
5
|
} from "../../../types/artifacts.js";
|
|
5
6
|
|
|
6
7
|
import { EOL } from "node:os";
|
|
@@ -47,7 +48,9 @@ export class ArtifactManagerImplementation implements ArtifactManager {
|
|
|
47
48
|
this.#readFsData = readFsData ?? (() => this.#readFsDataFromFileSystem());
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
public async readArtifact<
|
|
51
|
+
public async readArtifact<
|
|
52
|
+
ContractNameT extends StringWithArtifactContractNamesAutocompletion,
|
|
53
|
+
>(
|
|
51
54
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
52
55
|
): Promise<GetArtifactByName<ContractNameT>> {
|
|
53
56
|
const artifactPath = await this.getArtifactPath(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ArtifactManager,
|
|
3
3
|
GetArtifactByName,
|
|
4
|
+
StringWithArtifactContractNamesAutocompletion,
|
|
4
5
|
} from "../../../../types/artifacts.js";
|
|
5
6
|
import type { HardhatRuntimeEnvironmentHooks } from "../../../../types/hooks.js";
|
|
6
7
|
|
|
@@ -13,7 +14,9 @@ class LazyArtifactManager implements ArtifactManager {
|
|
|
13
14
|
this.#artifactsPath = artifactsPath;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
public async readArtifact<
|
|
17
|
+
public async readArtifact<
|
|
18
|
+
ContractNameT extends StringWithArtifactContractNamesAutocompletion,
|
|
19
|
+
>(
|
|
17
20
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
18
21
|
): Promise<GetArtifactByName<ContractNameT>> {
|
|
19
22
|
const artifactManager = await this.#getArtifactManager();
|
|
@@ -1,50 +1,32 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
testRunDone,
|
|
5
|
+
testRunStart,
|
|
6
|
+
testWorkerDone,
|
|
7
|
+
} from "./hook-handlers/test.js";
|
|
6
8
|
|
|
7
9
|
export function getCoveragePath(rootPath: string): string {
|
|
8
10
|
return path.join(rootPath, "coverage");
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* internal public API only.
|
|
16
|
-
* - We know the HRE has been initialized by the time they are used.
|
|
14
|
+
* The following helpers are kept for backward compatibility with older versions
|
|
15
|
+
* of test runner plugins (hardhat-mocha, hardhat-node-test-runner) that import
|
|
16
|
+
* from "hardhat/internal/coverage".
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
export async function markTestRunStart(id: string): Promise<void> {
|
|
20
20
|
const { default: hre } = await import("../../../index.js");
|
|
21
|
-
|
|
22
|
-
assertHardhatInvariant(
|
|
23
|
-
hre instanceof HardhatRuntimeEnvironmentImplementation,
|
|
24
|
-
"Expected HRE to be an instance of HardhatRuntimeEnvironmentImplementation",
|
|
25
|
-
);
|
|
26
|
-
await hre._coverage.clearData(id);
|
|
27
|
-
}
|
|
21
|
+
await testRunStart(hre, id);
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
export async function markTestWorkerDone(id: string): Promise<void> {
|
|
31
25
|
const { default: hre } = await import("../../../index.js");
|
|
32
|
-
|
|
33
|
-
assertHardhatInvariant(
|
|
34
|
-
hre instanceof HardhatRuntimeEnvironmentImplementation,
|
|
35
|
-
"Expected HRE to be an instance of HardhatRuntimeEnvironmentImplementation",
|
|
36
|
-
);
|
|
37
|
-
await hre._coverage.saveData(id);
|
|
38
|
-
}
|
|
26
|
+
await testWorkerDone(hre, id);
|
|
39
27
|
}
|
|
40
28
|
|
|
41
29
|
export async function markTestRunDone(id: string): Promise<void> {
|
|
42
30
|
const { default: hre } = await import("../../../index.js");
|
|
43
|
-
|
|
44
|
-
assertHardhatInvariant(
|
|
45
|
-
hre instanceof HardhatRuntimeEnvironmentImplementation,
|
|
46
|
-
"Expected HRE to be an instance of HardhatRuntimeEnvironmentImplementation",
|
|
47
|
-
);
|
|
48
|
-
await hre._coverage.report(id);
|
|
49
|
-
}
|
|
31
|
+
await testRunDone(hre, id);
|
|
50
32
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { HookContext, TestHooks } from "../../../../types/hooks.js";
|
|
2
|
+
|
|
3
|
+
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
4
|
+
import { isObject } from "@nomicfoundation/hardhat-utils/lang";
|
|
5
|
+
|
|
6
|
+
import { CoverageManagerImplementation } from "../coverage-manager.js";
|
|
7
|
+
|
|
8
|
+
export default async (): Promise<Partial<TestHooks>> => ({
|
|
9
|
+
onTestRunStart: async (context, id, next) => {
|
|
10
|
+
await next(context, id);
|
|
11
|
+
await testRunStart(context, id);
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
onTestWorkerDone: async (context, id, next) => {
|
|
15
|
+
await next(context, id);
|
|
16
|
+
await testWorkerDone(context, id);
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
onTestRunDone: async (context, id, next) => {
|
|
20
|
+
await next(context, id);
|
|
21
|
+
await testRunDone(context, id);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export async function testRunStart(
|
|
26
|
+
context: HookContext,
|
|
27
|
+
id: string,
|
|
28
|
+
): Promise<void> {
|
|
29
|
+
if (context.globalOptions.coverage === true) {
|
|
30
|
+
assertHardhatInvariant(
|
|
31
|
+
"_coverage" in context &&
|
|
32
|
+
isObject(context._coverage) &&
|
|
33
|
+
context._coverage instanceof CoverageManagerImplementation,
|
|
34
|
+
"Expected HookContext#_coverage to be an instance of CoverageManagerImplementation",
|
|
35
|
+
);
|
|
36
|
+
await context._coverage.clearData(id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function testWorkerDone(
|
|
41
|
+
context: HookContext,
|
|
42
|
+
id: string,
|
|
43
|
+
): Promise<void> {
|
|
44
|
+
if (context.globalOptions.coverage === true) {
|
|
45
|
+
assertHardhatInvariant(
|
|
46
|
+
"_coverage" in context &&
|
|
47
|
+
isObject(context._coverage) &&
|
|
48
|
+
context._coverage instanceof CoverageManagerImplementation,
|
|
49
|
+
"Expected HookContext#_coverage to be an instance of CoverageManagerImplementation",
|
|
50
|
+
);
|
|
51
|
+
await context._coverage.saveData(id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function testRunDone(
|
|
56
|
+
context: HookContext,
|
|
57
|
+
id: string,
|
|
58
|
+
): Promise<void> {
|
|
59
|
+
if (context.globalOptions.coverage === true) {
|
|
60
|
+
assertHardhatInvariant(
|
|
61
|
+
"_coverage" in context &&
|
|
62
|
+
isObject(context._coverage) &&
|
|
63
|
+
context._coverage instanceof CoverageManagerImplementation,
|
|
64
|
+
"Expected HookContext#_coverage to be an instance of CoverageManagerImplementation",
|
|
65
|
+
);
|
|
66
|
+
await context._coverage.report(id);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -17,6 +17,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
17
17
|
clean: () => import("./hook-handlers/clean.js"),
|
|
18
18
|
hre: () => import("./hook-handlers/hre.js"),
|
|
19
19
|
solidity: () => import("./hook-handlers/solidity.js"),
|
|
20
|
+
test: () => import("./hook-handlers/test.js"),
|
|
20
21
|
},
|
|
21
22
|
npmPackage: "hardhat",
|
|
22
23
|
};
|