-
-
Notifications
You must be signed in to change notification settings - Fork 558
/
Greeter.ts
28 lines (22 loc) · 921 Bytes
/
Greeter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import hre from "hardhat";
import { Artifact } from "hardhat/types";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
import { Greeter } from "../typechain/Greeter";
import { Signers } from "../types";
import { shouldBehaveLikeGreeter } from "./Greeter.behavior";
const { deployContract } = hre.waffle;
describe("Unit tests", function () {
before(async function () {
this.signers = {} as Signers;
const signers: SignerWithAddress[] = await hre.ethers.getSigners();
this.signers.admin = signers[0];
});
describe("Greeter", function () {
beforeEach(async function () {
const greeting: string = "Hello, world!";
const greeterArtifact: Artifact = await hre.artifacts.readArtifact("Greeter");
this.greeter = <Greeter>await deployContract(this.signers.admin, greeterArtifact, [greeting]);
});
shouldBehaveLikeGreeter();
});
});