From 65deb7f0f59f285c1ebcadf5e5491eb95a6b4ffe Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 26 Aug 2023 00:52:18 +0200 Subject: [PATCH] test: fix flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/utils.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/utils.test.js b/tests/utils.test.js index c00f0307..42a0668a 100644 --- a/tests/utils.test.js +++ b/tests/utils.test.js @@ -27,10 +27,10 @@ describe('Utils test suite', () => { }) it('Verify sleep() behavior', async () => { - const now = performance.now() + const start = performance.now() await sleep(1000) - const elapsed = performance.now() - now - expect(elapsed).toBeGreaterThanOrEqual(1000) + const stop = performance.now() + expect(stop - start).toBeGreaterThanOrEqual(1000) }) it('Verify exponentialDelay() behavior', () => { -- 2.34.1