GenerateSaaS

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

CommandNeedsPromise
pnpm testNode 22 and pnpm installturbo run test --concurrency=4 - 0 failed, 0 skipped. No .env, no Docker, no keys, no network
pnpm e2e:cipnpm infra + Chromium, installed once while online0 failed, 0 skipped. No keys, no internet, no .env
pnpm --filter desktop e2e:desktop:cithe same, plus Electron's system libraries on Linuxthe same
pnpm test:livevendor and Stripe keysopt-in. Runs what is configured, prints one not run: line for the rest. A key that is present and refused fails
pnpm e2e:livepnpm infra + keys and/or a coding CLI that can complete a turnopt-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.

FactValue
Download~144 MB per platform, hydrated on your first pnpm install
Platformsdarwin arm64/x64, linux arm/arm64/ia32/ppc64/x64, windows x64
ElsewhereSet 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:ci

The suites install nothing themselves. When the browser is missing, preflight fails in seconds and names that exact command.

Per-package commands

CommandWhat it does
pnpm --filter <pkg> testone package's suite
pnpm --filter <pkg> test:watchwatch mode while developing
pnpm --filter web e2ePlaywright's interactive UI mode
pnpm --filter web exec playwright show-reportthe last HTML report

Reports land in apps/web/playwright-report/; that folder and test-results/ are git-ignored.

On this page