From 803d964a7efc122dda1aaac5ea440b845b360815 Mon Sep 17 00:00:00 2001 From: Tristan Timblin Date: Mon, 29 Jan 2024 08:53:11 -0800 Subject: [PATCH] CEC-0000: allow test to be off by 1ms (#499) --- src/utils/polling.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/polling.test.js b/src/utils/polling.test.js index 18c3fbf..3c27c94 100644 --- a/src/utils/polling.test.js +++ b/src/utils/polling.test.js @@ -14,7 +14,7 @@ describe("Polling", () => { const poll = new Polling(callback, 100); const spy = jest.spyOn(poll, "callback"); poll.start(); - await sleep(500); + await sleep(501); // +1 for safety poll.end(); await sleep(500); expect(spy).toHaveBeenCalledTimes(5); @@ -25,7 +25,7 @@ describe("Polling", () => { const poll = new Polling(callback, 100); const spy = jest.spyOn(poll, "callback"); poll.start(); - await sleep(1000); + await sleep(1001); // +1 for safety expect(spy).toHaveBeenCalledTimes(5); }); });