Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsnickbarry/buidler-test-isolater
Reinitialize the Buidler Runtime Environment before each Mocha test 🚧 ☕
https://github.com/itsnickbarry/buidler-test-isolater
blockchain buidler ethereum fork mocha smart-contracts solidity test wow
Last synced: 9 days ago
JSON representation
Reinitialize the Buidler Runtime Environment before each Mocha test 🚧 ☕
- Host: GitHub
- URL: https://github.com/itsnickbarry/buidler-test-isolater
- Owner: ItsNickBarry
- License: mit
- Created: 2020-08-22T03:36:58.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-22T03:46:42.000Z (about 4 years ago)
- Last Synced: 2024-10-13T00:11:11.131Z (about 1 month ago)
- Topics: blockchain, buidler, ethereum, fork, mocha, smart-contracts, solidity, test, wow
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Buidler Test Isolater
Reinitialize the Buidler Runtime Environment before each Mocha test.
## Installation
```bash
yarn add --dev buidler-test-isolater
```## Usage
Load plugin in Buidler config:
```javascript
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](https://mochajs.org/#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.