Files
faunosteo/packages/supabase/tests/client.test.ts
T
bchanot ce76c6597a feat(supabase): @faunosteo/supabase package with PGlite harness and typed client
- tests/db: PGlite (PostgreSQL 17 WASM) applies the Supabase shim + migrations and
  runs supabase/tests/*.sql through pgTAP without Docker
- schema-types test pins tables, columns, enums, RPC args, RLS-on, no using(true)
- database.types.ts in supabase gen types format; createBrowserClient (PKCE)
- Supabase CLI pinned as root devDependency; db:* root scripts
2026-10-08 22:20:54 +02:00

22 lines
815 B
TypeScript

import { createBrowserClient, Constants, type PlatformRole } from '../src'
describe('createBrowserClient', () => {
it('builds a typed client bound to the given project URL', () => {
const client = createBrowserClient({
url: 'http://127.0.0.1:54321',
anonKey: 'anon-key-placeholder',
})
expect(typeof client.from).toBe('function')
expect(client.auth).toBeDefined()
// supabase-js keeps the resolved REST URL on the client instance.
expect(String((client as unknown as { supabaseUrl: string }).supabaseUrl)).toContain(
'127.0.0.1:54321',
)
})
it('exposes the platform roles as runtime constants', () => {
const roles: readonly PlatformRole[] = Constants.public.Enums.platform_role
expect(roles).toEqual(['owner', 'admin', 'moderator', 'support'])
})
})