Fixtures
Reusable test setup.
The Setup Problem
Many tests need the same starting state — a deployed contract, funded accounts, initial config. Repeating this setup in every beforeEach is slow and repetitive.
Fixtures solve this by running setup once and snapshotting the result.
What Is loadFixture
Hardhat provides loadFixture in its network helpers. The first time it runs a fixture function and takes an EVM snapshot. Later calls simply revert to that snapshot instead of re-running everything.
This makes tests both fast and perfectly isolated.