Tests
Tests run with Vitest.
Unit tests
bash
pnpm exec vitest run tests/unitThese cover Max's logic in lib/max/: the insight rules, the split, the drafted messages and the sentence parser in all three languages. They need no database.
Integration tests
tests/integration/ covers the server actions against a real database: creating a plan, answering, taking and giving up an item, and two people taking the same item at once.
They bring their own database. tests/setup/global.ts starts an in-memory Postgres (PGlite) before the tests and creates the schema in it, and tests/setup/db.ts empties it for each test. Nothing is installed or started by hand, and the database in .env is never used.
bash
pnpm testruns both suites.
Type checking
bash
pnpm exec tsc --noEmitpnpm build type-checks as well.