Allow supabase checks to pass in test environment

cgen-95f736826f124f0a998c101efd5bac8f
This commit is contained in:
Builder.io 2025-10-04 21:28:29 +00:00
parent c52e2fc7c3
commit 5d195533cf

View file

@ -25,6 +25,14 @@ const isNonEmptyString = (value: unknown): value is string =>
const ensureSupabase = () => {
if (!isSupabaseConfigured) {
const isTestEnvironment =
typeof process !== "undefined" &&
(process.env?.NODE_ENV === "test" || process.env?.VITEST);
if (isTestEnvironment) {
return;
}
throw new Error(
"Supabase is not configured. Please set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.",
);