Testing
What each test command needs, what it promises, and where the deeper pages are.
Three gates ship: Vitest unit tests, a deterministic Playwright end-to-end suite, and opt-in live suites that call real vendors. The first two need no keys, no network, and no .env.
The gate contract
| Command | Needs | Promise |
|---|---|---|
pnpm test | Node 22 and pnpm install | turbo run test --concurrency=4 - 0 failed, 0 skipped. No .env, no Docker, no keys, no network |
pnpm e2e:ci | pnpm infra + Chromium, installed once while online | 0 failed, 0 skipped. No keys, no internet, no .env |
pnpm --filter desktop e2e:desktop:ci | the same, plus Electron's system libraries on Linux | the same |
pnpm test:live | vendor and Stripe keys | opt-in. Runs what is configured, prints one not run: line for the rest. A key that is present and refused fails |
pnpm e2e:live | pnpm infra + keys and/or a coding CLI that can complete a turn | opt-in, the same rule per spec |
"0 skipped" is literal. A test that cannot apply to your build is never registered, so the summary reports it as absent rather than skipped - see Writing tests.
The database pnpm test uses
@repo/api's suite starts its own Postgres on a free port under your temp directory, creates a run database, pushes the schema, and drops all of it again.
| Fact | Value |
|---|---|
| Download | ~144 MB per platform, hydrated on your first pnpm install |
| Platforms | darwin arm64/x64, linux arm/arm64/ia32/ppc64/x64, windows x64 |
| Elsewhere | Set GENERATESAAS_TEST_DATABASE_ADMIN_URL to a Postgres the suite may CREATE DATABASE on (windows arm64 has no package) |
A neon project needs that variable as a repository secret too: the serverless driver cannot reach a local server, so the generated checks job fails at global setup without one. A run killed with Ctrl-C can leave its run database behind; the next run sweeps it.
First run
pnpm infra # Postgres, Redis, Mailpit, Inngest, MinIO
pnpm --filter web exec playwright install --with-deps chromium # once, online
pnpm test && pnpm e2e:ciThe suites install nothing themselves. When the browser is missing, preflight fails in seconds and names that exact command.
Per-package commands
| Command | What it does |
|---|---|
pnpm --filter <pkg> test | one package's suite |
pnpm --filter <pkg> test:watch | watch mode while developing |
pnpm --filter web e2e | Playwright's interactive UI mode |
pnpm --filter web exec playwright show-report | the last HTML report |
Reports land in apps/web/playwright-report/; that folder and test-results/ are git-ignored.
Writing tests
Conventions, the zero-skip policy, conditional registration, premise tests, and the guard that enforces them.
End-to-end tests
The harness, preflight, the offline fakes, the live gate, and the loop knobs.
Live vendor tests
The opt-in lane that calls Stripe and the AI providers for real - what it proves, what it costs, and how it gates.
Development
Dev scripts, code style, and adding dependencies the workspace-safe way.
Deployment
Ship the app and run the same checks in CI.
Development
The everyday workflow - root pnpm + Turborepo scripts, the enforced code style, the pre-commit translate hook, and the workspace-safe way to add dependencies.
Writing tests
Unit-test conventions, the zero-skip policy and the conditional registration that replaces it, premise tests, and the opt-in suites.