Introduce test environment constants

cgen-00bb749c34c44a2abe18c61f85704386
This commit is contained in:
Builder.io 2025-10-04 21:30:42 +00:00
parent 5d195533cf
commit dfa13a0b3e

View file

@ -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;
}