Skip to main content

Testing safely

Use deterministic fakes by default. Integration and E2E tests must use a disposable database whose name is clearly test-scoped; do not point DATABASE_URL at production.

LayerCommand / prerequisiteWhat it protects
Formatting and lintpnpm format:check, pnpm lintConsistent source and static rules.
Dependency boundariespnpm deps:checkInward architecture.
Type/buildpnpm typecheck, pnpm buildType and package/build contracts.
Unit + contractpnpm testInvariants and adapter-family contracts.
PostgreSQL integrationpnpm db:test:up; test-scoped DATABASE_URL; pnpm test:integration; pnpm db:test:downMigrations, transactions, isolation, queue behavior.
Browser E2Epnpm test:e2eCritical Admin/browser behavior.
Local Compose E2Epnpm test:e2e:composeDeterministic provider onboarding and knowledge ingestion through the real local stack.
Production Compose E2Epnpm test:e2e:productionTLS, auth, role isolation, backup/restore, and both runtime modes with private fixtures.

PG_BOSS_INTEGRATION=1 is only a test prerequisite where the integration suite names it. Live AI testing is opt-in and budget-capped; normal tests and docs commands never call a provider or require a production credential. Clean test state explicitly even after a failure.