Skip to content

Commit

Permalink
improve timestamp test
Browse files Browse the repository at this point in the history
  • Loading branch information
carneiro-cw committed Feb 27, 2024
1 parent e9ac4fd commit 969d430
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e2e/test/e2e-json-rpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ describe("JSON-RPC", () => {

it("Should reset the changes when sending 0", async () => {
await send("evm_setNextBlockTimestamp", [0]);
let mined_timestamp = Math.floor(Date.now() / 1000);
await send("evm_mine", []);
expect((await latest()).timestamp).approximately(Math.floor(Date.now() / 1000), 1);
let latest_timestamp = (await latest()).timestamp;
expect(latest_timestamp).gte(mined_timestamp).lte(Math.floor(Date.now() / 1000));
})

it("Should handle negative offsets", async () => {
Expand Down

0 comments on commit 969d430

Please sign in to comment.