From e7ba505842e9644a343dda59957d2dffc237d138 Mon Sep 17 00:00:00 2001 From: Jagget Date: Fri, 9 Jan 2026 15:21:04 -0500 Subject: [PATCH] fix(mock-doc): handle undefined delay in setTimeout/setInterval --- src/mock-doc/window.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mock-doc/window.ts b/src/mock-doc/window.ts index 585b21991cf..05a0a029a85 100644 --- a/src/mock-doc/window.ts +++ b/src/mock-doc/window.ts @@ -463,7 +463,7 @@ export class MockWindow { this.__timeouts = new Set(); } - ms = Math.min(ms, this.__maxTimeout); + ms = Math.min(ms ?? 0, this.__maxTimeout); if (this.__allowInterval) { const intervalId = this.__setInterval(() => { @@ -521,7 +521,7 @@ export class MockWindow { this.__timeouts = new Set(); } - ms = Math.min(ms, this.__maxTimeout); + ms = Math.min(ms ?? 0, this.__maxTimeout); const timeoutId = this.__setTimeout.call( nativeWindow || this,