Created
March 19, 2020 00:08
-
-
Save yurenju/11d369bf25ff5298744bca29774bc9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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