From 2c15a7ecfadcf37b6d02c5e637055154d0fa0e27 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Sat, 2 Aug 2025 16:31:37 -0700 Subject: [PATCH] Update src/util/exponentialBackoff.test.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- src/util/exponentialBackoff.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/exponentialBackoff.test.ts b/src/util/exponentialBackoff.test.ts index 4edceb7d9..5b1b44f84 100644 --- a/src/util/exponentialBackoff.test.ts +++ b/src/util/exponentialBackoff.test.ts @@ -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