From dfa13a0b3e0faaaf7145d0aa4ab0c2494026111c Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 4 Oct 2025 21:30:42 +0000 Subject: [PATCH] Introduce test environment constants cgen-00bb749c34c44a2abe18c61f85704386 --- client/lib/aethex-database-adapter.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 8330ab8a..1d115361 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -2,6 +2,7 @@ import { supabase, isSupabaseConfigured } from "@/lib/supabase"; import type { Database } from "./database.types"; +import { mockAuth } from "./mock-auth"; // Use the existing database user profile type directly import type { UserProfile } from "./database.types"; @@ -23,12 +24,12 @@ export interface AethexUserProfile extends UserProfile { const isNonEmptyString = (value: unknown): value is string => typeof value === "string" && value.trim().length > 0; +const isTestEnvironment = + typeof process !== "undefined" && + (process.env?.NODE_ENV === "test" || process.env?.VITEST); + const ensureSupabase = () => { if (!isSupabaseConfigured) { - const isTestEnvironment = - typeof process !== "undefined" && - (process.env?.NODE_ENV === "test" || process.env?.VITEST); - if (isTestEnvironment) { return; }