Skip to content

Add tests for DB-touching routes #32

Description

@migingyn

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions