Browse Source

fix: update tests to work with updated target

zemse 4 năm trước cách đây
mục cha
commit
b88595e486
2 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 2 4
      test/Greeter.ts
  2. 1 1
      types/augmentations.d.ts

+ 2 - 4
test/Greeter.ts

@@ -1,10 +1,8 @@
 import { Signer } from "@ethersproject/abstract-signer";
 import { ethers, waffle } from "hardhat";
 
-import GreeterArtifact from "../artifacts/contracts/Greeter.sol/Greeter.json";
-
 import { Accounts, Signers } from "../types";
-import { Greeter } from "../typechain/Greeter";
+import { Greeter__factory } from "../typechain";
 import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
 
 const { deployContract } = waffle;
@@ -22,7 +20,7 @@ describe("Unit tests", function () {
   describe("Greeter", function () {
     beforeEach(async function () {
       const greeting: string = "Hello, world!";
-      this.greeter = (await deployContract(this.signers.admin, GreeterArtifact, [greeting])) as Greeter;
+      this.greeter = await new Greeter__factory(this.signers.admin).deploy(greeting);
     });
 
     shouldBehaveLikeGreeter();

+ 1 - 1
types/augmentations.d.ts

@@ -1,5 +1,5 @@
 import { Accounts, Signers } from "./";
-import { Greeter } from "../typechain/Greeter";
+import { Greeter } from "../typechain";
 
 declare module "mocha" {
   export interface Context {