Greeter.ts 839 B

123456789101112131415161718192021222324252627
  1. import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
  2. import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
  3. import { ethers } from "hardhat";
  4. import type { Signers } from "../types";
  5. import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
  6. import { deployGreeterFixture } from "./Greeter.fixture";
  7. describe("Unit tests", function () {
  8. before(async function () {
  9. this.signers = {} as Signers;
  10. const signers: SignerWithAddress[] = await ethers.getSigners();
  11. this.signers.admin = signers[0];
  12. this.loadFixture = loadFixture;
  13. });
  14. describe("Greeter", function () {
  15. beforeEach(async function () {
  16. const { greeter } = await this.loadFixture(deployGreeterFixture);
  17. this.greeter = greeter;
  18. });
  19. shouldBehaveLikeGreeter();
  20. });
  21. });