Skip to content

Commit

Permalink
test: better replacement for chai's .closeTo
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Feb 14, 2023
1 parent 084fb8a commit ac44657
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __test__/messageHandler/handlers/heartbeat/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Heartbeat handler', () => {
const nowTime = new Date().getTime();

HeartbeatHandler(client);

expect(client.getLastPing()).toBeCloseTo(nowTime, 2);
expect(client.getLastPing()).toBeGreaterThanOrEqual(nowTime-2)
expect(nowTime).toBeGreaterThanOrEqual(client.getLastPing())
});
});

0 comments on commit ac44657

Please sign in to comment.