Skip to content

Instantly share code, notes, and snippets.

@sogoiii
Created June 30, 2017 19:01
Show Gist options
  • Save sogoiii/55a9e76aaf09e7c6f5af1a4d8a1ab721 to your computer and use it in GitHub Desktop.
Save sogoiii/55a9e76aaf09e7c6f5af1a4d8a1ab721 to your computer and use it in GitHub Desktop.
Truffle async test with time travel
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