Greeter.ts 844 B

12345678910111213141516171819202122232425262728
  1. import { Signer } from "@ethersproject/abstract-signer";
  2. import { ethers, waffle } from "hardhat";
  3. import { Accounts, Signers } from "../types";
  4. import { Greeter__factory } from "../typechain";
  5. import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
  6. const { deployContract } = waffle;
  7. describe("Unit tests", function () {
  8. before(async function () {
  9. this.accounts = {} as Accounts;
  10. this.signers = {} as Signers;
  11. const signers: Signer[] = await ethers.getSigners();
  12. this.signers.admin = signers[0];
  13. this.accounts.admin = await signers[0].getAddress();
  14. });
  15. describe("Greeter", function () {
  16. beforeEach(async function () {
  17. const greeting: string = "Hello, world!";
  18. this.greeter = await new Greeter__factory(this.signers.admin).deploy(greeting);
  19. });
  20. shouldBehaveLikeGreeter();
  21. });
  22. });