Greeter.ts 749 B

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