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,36 @@
|
||||
/**
|
||||
* Runs every pgTAP file under supabase/tests against a migrated PGlite
|
||||
* database. One vitest case per SQL file: the failing TAP lines are the
|
||||
* assertion message, so a red test names the exact pgTAP check.
|
||||
*/
|
||||
import type { PGlite } from '@electric-sql/pglite'
|
||||
import {
|
||||
createMigratedDatabase,
|
||||
listPgTapTests,
|
||||
runPgTapFile,
|
||||
} from './harness'
|
||||
|
||||
const files = await listPgTapTests()
|
||||
|
||||
describe('pgTAP suite (supabase/tests) on PGlite', () => {
|
||||
let db: PGlite
|
||||
|
||||
beforeAll(async () => {
|
||||
db = await createMigratedDatabase()
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await db?.close()
|
||||
})
|
||||
|
||||
it('finds at least one pgTAP file', () => {
|
||||
expect(files.length).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
it.each(files)('%s passes', async (file) => {
|
||||
const report = await runPgTapFile(db, file)
|
||||
const okCount = report.lines.filter((l) => /^ok\b/.test(l)).length
|
||||
expect(report.failures, report.lines.join('\n')).toEqual([])
|
||||
expect(okCount).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user