Skip to main content

Test suites breakdown

Every test runner KA26 uses, what each one covers, where the files live.

Marketplace root suite (Vitest, npm test)

Total: 2668 tests, all green as of 2026-05-01.

Lives in /Users/.../marketplace/tests/. Run via npm test from the marketplace repo root. Uses Vitest with Node environment by default; // @vitest-environment jsdom directive in any file under tests/components/ switches to jsdom for that file only.

What's actually inside the 2668

BucketApprox countWhat it coversExamples
Web app file-shape~1100Next.js routes, src/lib/*, src/components/*analytics-events.test.ts, api-shape-contracts.test.ts, app-isolation.test.ts
Cross-app contracts~800Reads mobile/, mobile-seller/, mobile-doctor/ source as textmobile-code-integrity.test.ts (189 tests for consumer mobile), seller-bid-lifecycle.test.ts (68 tests for seller bid screen)
API integration~300Hits real Next.js API routes (mocked DB or live)api-method-coverage.test.ts, auth-gates-regression.test.ts
Schema / DB~80Reads prisma/schema.prisma as text + some live DB pingsdb-pool.test.ts
jsdom component integration~30Real React mount, simulated clickstests/components/SellerNotificationToast.test.tsx, VoiceRecorder.test.tsx
Skipped / pending231Mostly Eats (decommissioned 2026-04-17) + flaky integration tests

Key files (worth knowing by name)

FileWhat it pins
tests/analytics-events.test.tsEvery event in the EventType union + every track() call site
tests/seller-bid-lifecycle.test.tsAll seller-side bid behavior (BUG-006a/b/c/d/e + BUG-007). 68 tests.
tests/voice-search.test.tsVoice search Sarvam pipeline contract
tests/voice-format-and-routing.test.tsBUG-003 (audio format) + BUG-004 (intent routing)
tests/regional-search.test.tsBUG-005 (Kannada/Hindi transliteration)
tests/app-isolation.test.tsThe 4 auth surfaces (consumer/seller/doctor/delivery) never cross-import
tests/build-integrity.test.tsNext.js build doesn't fail (~500 cheap structural checks)
tests/admin-dashboard.test.ts139 tests — every admin screen + action
tests/post-deploy-smoke.test.ts30 tests — runs against PROD after every deploy

Mobile consumer suite (cd mobile && npm test)

Jest + React Native Testing Library. Lives in mobile/__tests__/.

Current state: 422 pass / 9 pre-existing fail / 12 skipped (443 total).

The 9 failures are all in tests/api-integration.test.ts and api-response-shapes.test.ts — they hit /api/restaurants which was decommissioned 2026-04-17. The data was preserved for archival but the endpoint isn't extended anymore. These tests need to be deleted; they remain because nobody has done it yet.

What it covers

  • mobile-code-integrity.test.ts — 189 file-shape tests on the mobile sources (parallel to the marketplace-root version). This file actually lives in BOTH suites for now.
  • screen-completeness.test.ts — 72 tests checking all screens exist + handle empty state
  • ui-consistency.test.ts — 54 tests on COLORS, design tokens, typography
  • api-endpoints-auth.test.ts — 35 tests hitting prod APIs with various auth tokens
  • post-deploy-smoke.test.ts — 30 tests
  • __tests__/unit/NegotiationCard.test.tsx, MyBidsScreen.test.tsx, ProductDetailNegotiation.test.tsx — bid UI mounting tests

Mobile seller suite (cd mobile-seller && npm test)

Jest. Lives in mobile-seller/__tests__/.

Current state: 86 pass / 5 pre-existing fail / 91 total.

The 5 failures are in earnings/home/orders integration tests and are pre-existing (broken before any of the 2026-04 to 2026-05 work). They depend on prod DB state that has changed.

Key files

  • __tests__/components/SellerOffersScreen.test.tsx — render-mount sanity for the bids inbox. Covers regression class "hooks-after-early-return crash" + counter modal interaction.
  • __tests__/integration/orders.test.tsx — pre-existing failures here, not from our work
  • __tests__/integration/profile.test.tsx — passes when run alone, fails in parallel run (test pollution)

Mobile doctor suite (cd mobile-doctor && npm test)

Rarely run. Doctor flow has been deprioritized — see project_prescription_deprioritized.md in the personal memory.

Live e2e smoke (hourly cron)

Lives in .github/workflows/health-check.yml. Runs every hour at :17 past.

What it testsFile
/api/health returns 200inline curl
End-to-end smoke (browse → product → cart)tests/e2e-smoke.test.ts
Signup smoke (create + verify + delete throwaway user)tests/e2e-signup-smoke.test.ts
Critical funnel smoketests/e2e-critical-funnels-smoke.test.ts
SSL cert expiry checkinline openssl

Failures email myotpservice25@gmail.com. Created after the 6-day [object Object] registration outage — the lesson is that file-shape tests are necessary but never sufficient.

CI behavior

WorkflowWhenWhat
.github/workflows/deploy.ymlPush to mainRuns npm test (the full 2668), then gcloud builds submit, then gcloud run deploy. A failure here aborts the deploy.
.github/workflows/health-check.ymlEvery hour at :17Hits prod API + runs the 4 e2e smoke files

Adding a test

The full pattern is in Writing tests. Quick rules:

  1. Most tests should be layer-1 file-shape (cheap, fast, catches accidental deletion)
  2. New UI components → also add layer-2 component integration (tests/components/Foo.test.tsx)
  3. Backend changes → add layer-4 live verification recipe to your PR description (so the next person can re-run it)
  4. Don't bypass the rule: every new feature needs a contract test BEFORE the code lands. Prevents "I'll add a test later" tech debt.