Greeter.ts 729 B

123456789101112131415161718192021222324
  1. import { Signer } from "@ethersproject/abstract-signer";
  2. import { deployContract } from "ethereum-waffle";
  3. import { ethers } from "@nomiclabs/buidler";
  4. import GreeterArtifact from "../artifacts/Greeter.json";
  5. import { Greeter } from "../typechain/Greeter";
  6. import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
  7. setTimeout(async function () {
  8. const signers: Signer[] = await ethers.getSigners();
  9. const admin: Signer = signers[0];
  10. describe("Greeter", function () {
  11. beforeEach(async function () {
  12. const greeting: string = "Hello, world!";
  13. this.greeter = (await deployContract(admin, GreeterArtifact, [greeting])) as Greeter;
  14. });
  15. shouldBehaveLikeGreeter(signers);
  16. });
  17. run();
  18. }, 1000);