Created
June 30, 2017 19:01
-
-
Save sogoiii/55a9e76aaf09e7c6f5af1a4d8a1ab721 to your computer and use it in GitHub Desktop.
Truffle async test with time travel
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
it("should successfully call specialFn because enough time passed", async function () { | |
let meta = await MetaCoin.new(); | |
await timeTravel(86400 * 3) //3 days later | |
await mineBlock() // workaround for https://github.com/ethereumjs/testrpc/issues/336 | |
let status = await meta.specialFn.call(); | |
assert.equal(status, true, "specialFn should be callable after 1 day") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment