Contributing

Testing

How tests are organized and run.

The repo has a test suite that runs on every PR.

Frameworks

SurfaceFramework
Web (apps/web)bun test + happy-dom + React Testing Library + MSW
Web E2E (apps/web/e2e)Playwright, API and Stripe faked in the browser
API (apps/api)bun test + Postgres test container
Packagesbun test

Run them

bun run test                    # All tests across the workspace
bun run --filter './apps/web' test
bun run --filter './packages/*' test
bun run test:e2e                # Playwright browser E2E (apps/web)

Conventions

  • Test files live next to source: foo.ts + foo.test.ts
  • Web tests use MSW to mock the API at the network layer (no module mocks of the api-client)
  • API tests run against a real Postgres in CI (Docker service container), no mocked DB

Coverage

Web has bun test --coverage (bun run test:coverage) wired up. CI doesn't gate on coverage; it's a guideline, not a rule.

On this page