Buidler Test Isolater
Reinitialize the Buidler Runtime Environment before each Mocha test.
yarn add --dev buidler-test-isolater
Load plugin in Buidler config:
This plugin is intended for use in combination with the
buidler-ganache plugin when testing against a forked network. Re-initializing the network before each test prevents errors such as the following:
Error: Returned error: project ID does not have access to archive state
This plugin is not compatible with Mocha
describe-level exclusive tests.
Isolated tests are run via a temporary file
.buidler_test_isolater_tmp.js created in the buidler
tests directory. This file is deleted upon test completion, but may not be removed if test execution halts unexpectedly; therefore, it should be added to the
.gitignore file or deleted manually.