Update src/util/exponentialBackoff.test.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
parent
0347242d91
commit
2c15a7ecfa
1 changed files with 1 additions and 1 deletions
|
|
@ -207,7 +207,7 @@ describe("exponentialBackoff utilities", () => {
|
|||
|
||||
// Mock Math.random to return 0.5 (middle of jitter range)
|
||||
const originalRandom = Math.random;
|
||||
Math.random = vi.fn(() => 0.5);
|
||||
vi.spyOn(Math, 'random').mockReturnValue(0.5);
|
||||
|
||||
// With jitter factor of 0.5 + 0.5 * 0.5 = 0.75
|
||||
expect(calculateDelay(0, options)).toBe(750); // 1000 * 0.75
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue