Skip to content

Commit

Permalink
fix: assert promise is rejected and error is thrown after last retry
Browse files Browse the repository at this point in the history
  • Loading branch information
MantisClone committed Oct 2, 2024
1 parent b2019da commit 8c5cbc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/utils/test/retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ describe('Retry', () => {
expect(throwFn).toHaveBeenCalledTimes(8);
expect(Date.now()).toBe(127000);

// Reject and throw after the last retry
await expect(retryPromise).rejects.toThrow('threw');

// No further retries
jest.advanceTimersByTime(1000000000);
await Promise.resolve();
await expect(retryPromise).rejects.toThrow('threw');

expect(throwFn).toHaveBeenCalledTimes(8);
expect(Date.now()).toBe(1000127000);

Expand Down

0 comments on commit 8c5cbc1

Please sign in to comment.