test(integration): add real-stack integration test suite with PGlite
Docker Image CI / test (push) Successful in 1m47s
Tests / unit (push) Successful in 57s
Tests / integration (push) Successful in 1m38s
Docker Image CI / deploy (push) Failing after 8s

- 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
This commit is contained in:
2026-08-13 23:10:07 +02:00
parent 28714a8cbc
commit 01d1e5fb60
22 changed files with 1813 additions and 49 deletions
+4
View File
@@ -11,6 +11,7 @@
"format": "prettier --write .",
"check": "prettier --check .",
"test": "bun test",
"test:integration": "vitest run -c vitest.integration.config.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"typecheck": "nuxt typecheck",
@@ -46,12 +47,15 @@
"zod": "^4.4.3"
},
"devDependencies": {
"@electric-sql/pglite": "^0.5.5",
"@electric-sql/pglite-socket": "^0.2.8",
"@nuxt/devtools": "^2.6.4",
"@types/bun": "^1.2.20",
"prettier": "^3.6.2",
"prettier-plugin-organize-imports": "^4.2.0",
"prettier-plugin-tailwindcss": "^0.6.14",
"prisma": "^6.16.1",
"vitest": "^4.1.10",
"vue-tsc": "^3.0.6"
},
"patchedDependencies": {