Why
The migration only shipped tests for `twelvelabs` (mocked). Sessions, users, analyses, badges, feedback, goals, messages all have zero coverage. A real DB schema change can silently break any of them.
What
Set up either `pg-mem` (in-process) or a docker'd test Postgres (CI-friendly), then write happy-path + error-case tests for each route file.
Where to start
- New `server/tests/{users,sessions,analyses,badges,goals,messages,feedback}.test.ts`
- Update `server/vitest.config.ts` if pg-mem needs a global setup or schema bootstrap
- Wire test DB URL via `server/tests/setup.ts`
Done when
- Each route file has ≥3 tests covering happy path, validation failure, and one edge case
- Tests run via `npm --prefix server run test`
- Tests don't touch the prod Railway DB
Why
The migration only shipped tests for `twelvelabs` (mocked). Sessions, users, analyses, badges, feedback, goals, messages all have zero coverage. A real DB schema change can silently break any of them.
What
Set up either `pg-mem` (in-process) or a docker'd test Postgres (CI-friendly), then write happy-path + error-case tests for each route file.
Where to start
Done when