Skip to content

Instantly share code, notes, and snippets.

@yurenju
Created March 19, 2020 00:08
Show Gist options
  • Save yurenju/11d369bf25ff5298744bca29774bc9e4 to your computer and use it in GitHub Desktop.
Save yurenju/11d369bf25ff5298744bca29774bc9e4 to your computer and use it in GitHub Desktop.
import { use, expect } from "chai";
import { solidity, MockProvider, deployContract } from "ethereum-waffle";
import SKETokenArtifact from "../build/SKEToken.json";
import { SKEToken } from "../types/ethers-contracts/SKEToken";
use(solidity);
describe("Counter smart contract", () => {
const provider = new MockProvider();
const [wallet] = provider.getWallets();
async function deployToken(initialValue: string) {
const token = (await deployContract(wallet, SKETokenArtifact, [
initialValue
])) as SKEToken;
return token;
}
it("sets initial balance in the constructor", async () => {
const token = await deployToken("10000");
expect(await token.balanceOf(wallet.address)).to.equal("10000");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment