From b971a3ca4a894c53d65be9e01949c6f6bffb5af8 Mon Sep 17 00:00:00 2001 From: Vadim Taits Date: Sat, 2 Nov 2024 09:34:17 +0300 Subject: [PATCH] Make tests for `setRefreshTimeout` foolproof --- packages/filterlist/src/Filterlist.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/filterlist/src/Filterlist.test.ts b/packages/filterlist/src/Filterlist.test.ts index 7d4f69e..117fe30 100644 --- a/packages/filterlist/src/Filterlist.test.ts +++ b/packages/filterlist/src/Filterlist.test.ts @@ -1768,9 +1768,13 @@ describe.concurrent.each([ filterlist.setRefreshTimeout(30); - await sleep(100); + await sleep(40); - expect(loadItems).toHaveBeenCalledTimes(3); + expect(loadItems).toHaveBeenCalledTimes(1); + + await sleep(40); + + expect(loadItems).toHaveBeenCalledTimes(2); loadItems.mockClear(); filterlist.setRefreshTimeout(null);