Skip to content

Commit

Permalink
Make tests for setRefreshTimeout foolproof
Browse files Browse the repository at this point in the history
  • Loading branch information
vtaits committed Nov 2, 2024
1 parent 87ca2b0 commit b971a3c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/filterlist/src/Filterlist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b971a3c

Please sign in to comment.