https://github.com/fvictorio/hardhat-parallel-tests-setup-workaround
https://github.com/fvictorio/hardhat-parallel-tests-setup-workaround
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fvictorio/hardhat-parallel-tests-setup-workaround
- Owner: fvictorio
- Created: 2023-06-16T11:51:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T11:52:04.000Z (almost 2 years ago)
- Last Synced: 2025-03-14T15:56:45.090Z (3 months ago)
- Language: JavaScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Hardhat tests in parallel mode and TASK_TEST_SETUP_TEST_ENVIRONMENT workaround
Hardhat's `TASK_TEST_SETUP_TEST_ENVIRONMENT` subtask can be overriden to setup the environment before running the tests. But at the moment, this subtask doesn't work when the tests are run in parallel mode. This repository shows a workaround for this problem using [Mocha's Root Hooks](https://mochajs.org/#root-hook-plugins).
The way this works is that a `beforeAll` hooks is registered that explicitly runs that subtask.
You can check that this works by running both `npx hardhat test` and `npx hardhat test --parallel`.