Skip to content

Tests ​

Tests run with Vitest.

Unit tests ​

bash
pnpm exec vitest run tests/unit

These 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 test

runs both suites.

Type checking ​

bash
pnpm exec tsc --noEmit

pnpm build type-checks as well.