From ef5dc04dae3c06d75c2542bb937d992ae9e52645 Mon Sep 17 00:00:00 2001 From: Mauro Reis Vieira Date: Thu, 16 Jan 2025 18:55:10 +0000 Subject: [PATCH] fix: unit test windows delete --- packages/utilities/__tests__/unit/platform.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/utilities/__tests__/unit/platform.test.ts b/packages/utilities/__tests__/unit/platform.test.ts index 2dbf682d..86c0be0d 100644 --- a/packages/utilities/__tests__/unit/platform.test.ts +++ b/packages/utilities/__tests__/unit/platform.test.ts @@ -21,9 +21,10 @@ function mockNavigator(userAgent: string) { }); } -// Restore global `window` to its original state +// Simulate a non-browser environment function restoreWindow() { - global.window = window; // Reassign it to the default window object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (global as any).window = undefined; // Set `window` to `undefined` } // Helper to restore the default navigator