Skip to content

Update Mocha testing guide to reference connectOnBefore #216

@kanej

Description

@kanej

Update the testing guide to show the new connection pattern:

import { network } from "hardhat";

describe("Token", () => {
  const { ethers } = network.mocha.connectOnBefore();
 
  before(async () => {
      counter = await ethers.deployContract("Token");
  });

  it("has the correct total supply", async function () {
    const totalSupply = await token.totalSupply();
    assert.equal(totalSupply, ethers.parseEther("1000000"));
  });
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions