Spaces:
Paused
Paused
Download test/supabase.test.mjs from delqhi/sin-code-ai: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/delqhi/sin-code-ai/resolve/main/test/supabase.test.mjs
- Command line
-
hf download hf://spaces/delqhi/sin-code-ai/test/supabase.test.mjs
-
curl -L -o supabase.test.mjs https://huggingface.co/spaces/delqhi/sin-code-ai/resolve/main/test/supabase.test.mjs
702 Bytes
| import test from 'node:test'; | |
| import assert from 'node:assert/strict'; | |
| import { getSupabaseClient } from '../dist/src/supabase.js'; | |
| test('getSupabaseClient fails closed when credentials are missing', async () => { | |
| const originalUrl = process.env.SIN_SUPABASE_URL; | |
| const originalKey = process.env.SIN_SUPABASE_SERVICE_ROLE_KEY; | |
| delete process.env.SIN_SUPABASE_URL; | |
| delete process.env.SIN_SUPABASE_SERVICE_ROLE_KEY; | |
| try { | |
| assert.throws(() => getSupabaseClient(), /missing_supabase_credentials/); | |
| } finally { | |
| if (originalUrl !== undefined) process.env.SIN_SUPABASE_URL = originalUrl; | |
| if (originalKey !== undefined) process.env.SIN_SUPABASE_SERVICE_ROLE_KEY = originalKey; | |
| } | |
| }); | |