Testing at KA26 — Overview
Single-page tour of every test layer in the KA26 codebase. Detail pages drill into philosophy, the suites, running, writing, live verification, and regression tracking.
Why this section exists
KA26 ships fast — we have committed to a "no regression, ever" rule (see BUGS-FIXED.md in the marketplace repo). Every feature we ship has bitten us at least once when we changed something else and forgot to test the affected flow. The test layers below exist so a single npm test catches >95% of those regressions before they reach a tester.
If you're adding a feature: read Test philosophy first to know what kind of test to write.
If you're debugging a flaky test: read Test suites to find which file owns the assertion.
If you're verifying a live fix: read Live verification for the JWT-against-prod pattern we use.
The 4 layers at a glance
| Layer | Tool | What it catches | Speed |
|---|---|---|---|
| 1. File-shape contract | Vitest (node) | "Did someone delete this function call / i18n key / route?" | ~3s for 2600+ tests |
| 2. Component integration | Vitest (jsdom) + RTL | "Does the bell click navigate to the right URL? Does the modal show?" | ~1s per test |
| 3. Mobile component | Jest + RNTL (3 separate suites) | RN component mounts, callbacks fire, fake interactions work | 5-30s per app |
| 4. Live verification | curl + JWT + psql against prod | "Does the API actually return the right shape on real data?" | ad hoc / hourly cron |
These are NOT replacements for each other — each layer catches a different bug class. See Philosophy for the full mapping.
Numbers as of 2026-05-01
| Suite | Tests | Notes |
|---|---|---|
Marketplace root (npm test) | 2668 / 2668 pass | Web + cross-app file-shape + Vitest jsdom integration |
mobile/ (consumer Jest) | 422 pass / 9 pre-existing fails | Pre-existing fails are decommissioned /api/restaurants Eats tests — not from our work |
mobile-seller/ (Jest) | 86 pass / 5 pre-existing fails | Same pattern; failures are in earnings/home/orders integration tests, broken before this work |
mobile-doctor/ (Jest) | rarely run | Doctor flow deprioritized |
| Live e2e smoke (hourly cron) | 42 production checks | /api/health, e2e-smoke, e2e-signup-smoke, e2e-critical-funnels-smoke |
When you ship something
The minimum bar (per BUGS-FIXED.md "no regression" rule):
- Add a layer-1 file-shape test for any function/string you depend on
- Add a layer-2 jsdom test if you added a new UI component with user input
- Run
npm testfrom the marketplace root — must be green - For backend changes, do a layer-4 live verification against prod after deploy
- Update this doc if you introduced a new test pattern
Next pages
- Philosophy — when to use which test layer
- Test suites breakdown — every suite, what it covers
- Running tests — commands, environments, CI
- Writing tests — patterns, gotchas, examples
- Live verification — JWT + curl + psql against prod
- Bug tracking —
BUGS-FIXED.mdand the regression-guard pattern