Skip to content

Commit

Permalink
TroveManagerTest: make use of hardhat’s loadFixture()
Browse files Browse the repository at this point in the history
This is a test of migrating to loadFixture() using TroveManagerTest only
for now.

The migration consists of converting beforeEach() into a fixture, which
is recommended by Hardhat mostly for performance reasons [1].

On my computer, this test went from ~54s to ~18s (~67% faster).

Before:

pnpm test test/TroveManagerTest.js  53.90s user 6.48s system 145% cpu 41.495 total

After:

pnpm test test/TroveManagerTest.js  17.98s user 1.81s system 138% cpu 14.309 total

[1] https://hardhat.org/hardhat-runner/docs/guides/test-contracts#using-fixtures
  • Loading branch information
bpierre committed Apr 3, 2024
1 parent 97c746a commit 03f323e
Showing 1 changed file with 254 additions and 52 deletions.
Loading

0 comments on commit 03f323e

Please sign in to comment.