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:
Nate Sesti 2025-08-02 16:31:37 -07:00 • committed by GitHub
parent 0347242d91
commit 2c15a7ecfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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