Greeter.ts 924 B

1234567891011121314151617181920212223242526
  1. import { artifacts, ethers, waffle } from "hardhat";
  2. import type { Artifact } from "hardhat/types";
  3. import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
  4. import type { Greeter } from "../../src/types/Greeter";
  5. import { Signers } from "../types";
  6. import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
  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. });
  13. describe("Greeter", function () {
  14. beforeEach(async function () {
  15. const greeting: string = "Hello, world!";
  16. const greeterArtifact: Artifact = await artifacts.readArtifact("Greeter");
  17. this.greeter = <Greeter>await waffle.deployContract(this.signers.admin, greeterArtifact, [greeting]);
  18. });
  19. shouldBehaveLikeGreeter();
  20. });
  21. });