Files
orangecat/docs/testing
CatoandClaude 45fd5e076a docs: archive 2025 plans that read as current (#1351)
Forty-five 2025 plans, assessments, design scenarios, status reports and
superseded business docs move to docs/archive/ (same relative path). Each
described a plan or a snapshot as if it were the running system: strict:false,
a five-table schema, an "organization" entity, price_sats, a Gemini /api/chat
widget, a /auth/forgot-password page, Google Places, building group labels and
contract voting flows that never landed.

Fixed in place: NAVIGATION_UX_DESIGN.md (referenced by .claude/rules) gains a
status note naming what shipped and where; GENERIC_API_HANDLERS.md lists the
handler options the code actually takes; datetime_standards.md points at
scripts/dev/; CONTRIBUTING.md describes the auto-merge shipping flow. Inbound
links repointed (SECURITY.md at the root, SUPABASE_SCHEMA_GUIDE.md for schema).


Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:25:12 +02:00
..

OrangeCat testing

created_date: 2025-01-01 last_modified_date: 2026-09-23 last_modified_summary: Wave-6 Cat cull — dropped byok active-step source-grep; resolveProvider return is the contract.

What we believe

Signal beats headcount. A thousand tests that restate implementation are slower and weaker than a hundred that pin user-visible contracts and static invariants.

The real gate is pnpm run verify: typecheck, lint, and the check:* scripts (dead fields/labels, routes, currency units, schema columns, RPC existence, locale, changelog, …) then unit tests. Those static checks catch whole classes of rot that unit tests usually miss.

Layers

Layer Tool What belongs here
Static gates scripts/check-*.mjs inside verify Drift, forbidden patterns, SSOT
Unit Vitest Behaviour contracts, money paths, Cat tool/prompt invariants
E2E Playwright (@p0 matrix) Thin, sacred journeys that must work on a real browser

Do not grow Playwright to match unit volume. Do not chase a coverage percentage.

Cat tests (__tests__/unit/cat/)

Keep tests that fail when a user-visible or money-moving behaviour breaks, or when two sources of truth drift (registries, plan limits, provider lists, tool wiring).

Do not add:

  • Byte snapshots of prompt prose (they train people to update goldens instead of thinking)
  • Per-field exhaustiveness for every create handler (one table of forbidden/required columns is enough — see action-executor-columns.test.ts)
  • Source-grep theatre that breaks when Prettier wraps a line (unless the assertion is about wiring arguments or a TDZ order that typecheck cannot see, with whitespace collapsed)
  • A second file that re-pins the same ladder/order/fit relationship already covered in prompt-budget.test.ts

Commands

pnpm run test:unit          # what verify runs
pnpm exec vitest run __tests__/unit/cat   # Cat only
pnpm run test:e2e:matrix:p0 # sacred browser paths
pnpm run verify             # the real merge gate

When you change Cat

  1. Prefer extending an existing contract test over a new file.
  2. If a create handler learns a new money column name, add one row to the column contract table — not a new describe block with three variants.
  3. Run pnpm exec vitest run __tests__/unit/cat before push.