This commit is contained in:
12
apps/web/server/utils/runtime-config.test.ts
Normal file
12
apps/web/server/utils/runtime-config.test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { assertRequiredSupabaseConfig } from './runtime-config'
|
||||
|
||||
describe('required Supabase runtime config', () => {
|
||||
it('accepts complete credentials', () => {
|
||||
expect(() => assertRequiredSupabaseConfig({ supabaseUrl: 'https://example.supabase.co', supabaseServiceRoleKey: 'service', public: { supabaseUrl: 'https://example.supabase.co', supabaseAnonKey: 'anon' } })).not.toThrow()
|
||||
})
|
||||
|
||||
it('reports missing credentials clearly', () => {
|
||||
expect(() => assertRequiredSupabaseConfig({ public: {} })).toThrow('SUPABASE_SERVICE_ROLE_KEY is required')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user