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
This commit is contained in:
1 parent
2d5ff0c33e
commit
ce76c6597a
15 files changed
+1020
-2
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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'])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user