- PGlite (in-memory WASM Postgres) hosted in a child process, exposed via TCP socket; real migrations applied with prisma migrate deploy - Vitest harness (vitest.integration.config.ts, global-setup spawns PGlite + built Nuxt server, per-test TRUNCATE, factories, cookie-jar API client); no mocks, zero production code changes - 50 tests across auth, hunt, team, submit, review, showcase, diashow incl. SuperJSON envelope check; *.itest.ts keeps bun test untouched - CI: parallel unit + integration jobs in .github/workflows/test.yml - tests/ covered by nuxt typecheck via tests/tsconfig.json reference
24 lines
670 B
TypeScript
24 lines
670 B
TypeScript
import { fileURLToPath } from 'node:url';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const root = (path: string) => fileURLToPath(new URL(path, import.meta.url));
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'~~': root('.'),
|
|
'#shared': root('./shared')
|
|
}
|
|
},
|
|
test: {
|
|
include: ['tests/integration/**/*.itest.ts'],
|
|
globalSetup: ['tests/integration/global-setup.ts'],
|
|
setupFiles: ['tests/integration/setup.ts'],
|
|
fileParallelism: false,
|
|
// First touch of WASM Postgres can be slow; the build happens in
|
|
// globalSetup and is not affected by these timeouts.
|
|
testTimeout: 30_000,
|
|
hookTimeout: 120_000
|
|
}
|
|
});
|