You can run your tests in parallel by using the
$ npx hardhat test --parallel
parallel: true in the
mocha section of
hardhat.config, which will enable parallelism for plugins that don't have a
--parallel flag, like
Most of the time, running your tests serially or in parallel should produce the same results, but there are some scenarios where tests run in parallel will behave differently:
.onlymodifier doesn't work in parallel mode. As an alternative, you can use
--grep(opens new window) to run specific tests.
this.timeout()(opens new window) in your tests.
There are some other limitations related to parallel mode. You can read more about them in Mocha's docs (opens new window). And if you are running into some issue when using parallel mode, you can check their Troubleshooting parallel mode (opens new window) section.