github NomicFoundation/hardhat @nomicfoundation/hardhat-network-helpers@1.0.3

This version disallows using anonymous functions as fixtures.

This means that you can't do something like loadFixture(async () => { ... }). The reason we disallow this is that it prevents the result of the fixture from being cached, canceling the benefit of using fixtures.

What you want to do instead is to declare a function and use it in each call to loadFixture:

async function deployContracts() {
  // do stuff
}

it("test 1", async function () {
  const { someContracts } = await loadFixture(deployContracts);
  // ...
}

it("test 2", async function () {
  const { someContracts } = await loadFixture(deployContracts);
  // ...
}

If you have questions or concerns about this, please start a discussion.

Don't miss a new hardhat release

NewReleases is sending notifications on new releases.