← library
prompt✅ Testing & QAv2 · updated 2026-06-12

Test suite that earns its keep

Vitest + Playwright + CI gates: fast unit core, few real E2E flows.

Run it as a prompt

Paste this into any AI agent, or fetch it: curl -s https://uplift.page/api/v1/prompts/test-suite/raw

prompt.md
# Test suite that earns its keep

A test pyramid that catches regressions in minutes: lots of fast unit tests, focused integration tests, and a handful of E2E flows.

## Recommended stack

- **Vitest** - unit/integration. Vite-speed tests with first-class TS and watch mode you'll actually use.
- **Playwright** - E2E. Reliable cross-browser flows with traces that make failures debuggable.
- **GitHub Actions** - CI gate. No green, no merge - the suite only matters if it blocks.
- **Testing Library** - component tests. Tests that interact like users survive refactors.

## Build steps

1. Unit-test pure logic exhaustively (parsers, calculators, reducers) - milliseconds each.
2. Integration-test each API route against a real (containerized) database, not mocks of your own DB.
3. Choose 3–5 E2E journeys that map to revenue (signup, core action, checkout); nothing else.
4. Make tests deterministic: fake timers, seeded data, no network to third parties.
5. Quarantine flaky tests same-day with an issue; a flaky suite is an ignored suite.

## Watch out for

- Mocking the database in integration tests - you're testing your mocks.
- E2E for every edge case; pyramid inverts and CI takes 40 minutes.
- Snapshot tests as assertions of convenience that nobody reads on failure.

## Definition of done

- Unit+integration suite < 2 minutes locally
- A broken core flow fails CI before review
- Zero `skip`ped tests older than a week

The full prompt

A test pyramid that catches regressions in minutes: lots of fast unit tests, focused integration tests, and a handful of E2E flows.

Recommended stack

  • Vitest - unit/integration. Vite-speed tests with first-class TS and watch mode you'll actually use.
  • Playwright - E2E. Reliable cross-browser flows with traces that make failures debuggable.
  • GitHub Actions - CI gate. No green, no merge - the suite only matters if it blocks.
  • Testing Library - component tests. Tests that interact like users survive refactors.

Build steps

  1. Unit-test pure logic exhaustively (parsers, calculators, reducers) - milliseconds each.
  2. Integration-test each API route against a real (containerized) database, not mocks of your own DB.
  3. Choose 3–5 E2E journeys that map to revenue (signup, core action, checkout); nothing else.
  4. Make tests deterministic: fake timers, seeded data, no network to third parties.
  5. Quarantine flaky tests same-day with an issue; a flaky suite is an ignored suite.

Watch out for

  • Mocking the database in integration tests - you're testing your mocks.
  • E2E for every edge case; pyramid inverts and CI takes 40 minutes.
  • Snapshot tests as assertions of convenience that nobody reads on failure.

Definition of done

  • Unit+integration suite < 2 minutes locally
  • A broken core flow fails CI before review
  • Zero skipped tests older than a week

Served from the uplift.page library and refreshed within 5 minutes of every update.