buidler-test-isolater

1.0.0 • Public • Published

Buidler Test Isolater

Reinitialize the Buidler Runtime Environment before each Mocha test.

Installation

yarn add --dev buidler-test-isolater

Usage

Load plugin in Buidler config:

usePlugin('buidler-test-isolater');

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.

/buidler-test-isolater/

    Package Sidebar

    Install

    npm i buidler-test-isolater

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.28 kB

    Total Files

    5

    Last publish

    Collaborators

    • itsnickbarry