From a1dea07776735bb5e20f9ad951af9b7540d2178e Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Mon, 4 Jul 2022 20:45:41 +0300 Subject: [PATCH] Fixed non-deterministic tests --- test/function-utils.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/function-utils.test.ts b/test/function-utils.test.ts index 6585f48..37308fc 100644 --- a/test/function-utils.test.ts +++ b/test/function-utils.test.ts @@ -27,7 +27,7 @@ describe("retry", () => { expect(await retry({ func: createThrowingFunc(2), maxAttempts: 2, delay: 100 })).toBe(true); const end = new Date(); const duration = end.getTime() - start.getTime(); - expect(duration >= 100 && duration < 200).toBe(true); + expect(duration > 50 && duration < 200).toBe(true); }); test("the original error is thrown if retry function didn't succeed", async () => { @@ -53,7 +53,7 @@ describe("retry (async)", () => { expect(await retry({ func: createAsyncThrowingFunc(2), maxAttempts: 2, delay: 100 })).toBe(true); const end = new Date(); const duration = end.getTime() - start.getTime(); - expect(duration >= 100 && duration < 200).toBe(true); + expect(duration > 50 && duration < 200).toBe(true); }); test("the original error is thrown if retry function didn't succeed", async () => {