From 1b8b84213dfe984ae1e2f88af4f563220c5e3e7b Mon Sep 17 00:00:00 2001 From: Iku-turso Date: Mon, 23 May 2022 14:18:08 +0300 Subject: [PATCH] Make unit test more strict Co-authored-by: Janne Savolainen Signed-off-by: Iku-turso --- .../periodical-checking-of-updates.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/behaviours/application-update/periodical-checking-of-updates.test.ts b/src/behaviours/application-update/periodical-checking-of-updates.test.ts index 45e64702a6..4d63991abc 100644 --- a/src/behaviours/application-update/periodical-checking-of-updates.test.ts +++ b/src/behaviours/application-update/periodical-checking-of-updates.test.ts @@ -86,8 +86,8 @@ describe("periodical checking of updates", () => { expect(processCheckingForUpdatesMock).not.toHaveBeenCalled(); }); - it("when enough time passes for checking updates again, still does not check for updates", () => { - jest.advanceTimersByTime(ENOUGH_TIME); + it("when time passes, never checks for updates", () => { + jest.runOnlyPendingTimers(); expect(processCheckingForUpdatesMock).not.toHaveBeenCalled(); }); @@ -107,8 +107,8 @@ describe("periodical checking of updates", () => { expect(processCheckingForUpdatesMock).not.toHaveBeenCalled(); }); - it("when enough time passes for checking updates again, still does not check for updates", () => { - jest.advanceTimersByTime(ENOUGH_TIME); + it("when time passes, never checks for updates", () => { + jest.runOnlyPendingTimers(); expect(processCheckingForUpdatesMock).not.toHaveBeenCalled(); });