From 686380b531868bea79ac1b54a8bd136cbb3308eb Mon Sep 17 00:00:00 2001 From: Fern Sanchez Date: Mon, 3 Nov 2025 16:11:59 -0500 Subject: [PATCH] Don't patch test global environment --- src/client/environment.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/environment.ts b/src/client/environment.ts index 80900d1..1ab0375 100644 --- a/src/client/environment.ts +++ b/src/client/environment.ts @@ -86,6 +86,10 @@ export function setupEnvironment( getGenerationState: () => GenerationState, workflowId: string, ): void { + // If we're in a test, don't patch the global environment + if (process.env.VITEST === "true") { + return; + } const global = globalThis as Record; // Patch Math with seeded random based on workflowId @@ -119,7 +123,7 @@ export function setupEnvironment( }; } -function noop() {} +function noop() { } // exported for testing export function createConsole(