Skip to content

Testing Strategy

Status: Draft (stub) — aligns testing layers with monorepo architecture.

  • Fast feedback (unit + type tests) under 30s incremental.
  • Confidence in brand theming and feature gating.
  • Avoid duplication across web/mobile surfaces.
  1. Type-level (tsc —noEmit) — enforced via verify gate.
  2. Unit tests (Vitest for Vite web apps, Jest for React Native until parity).
  3. Integration smoke (serve + minimal render) — later via Playwright / Detox.
  4. Contract tests (registry schema + feature compatibility) — future.
  5. Visual regression (brand theming snapshots) — future opt-in.
SurfaceFrameworkRationale
Web (Vite)VitestNative Vite integration, fast transforms
Mobile (Expo)JestRN ecosystem alignment
Cross-libVitestSimplicity + shared config
  • Co-locate *.test.ts(x) with source.
  • Use data-testid for integration view selectors.
  • Avoid deep renderer mocks; prefer lightweight real component trees.
  • Stable snapshots only for theming/structure (not dynamic data).
  • Generate matrix test helper that iterates over brand keys (post type generation script) for theme assertions.
  • Skip heavy tests for experimental brands via tag filtering.
  • Focus on critical path (registry loader, theming adapter, navigation). Avoid chasing a raw percentage.
  • Add base vitest config for one web app
  • Add jest config template improvements (scaffold script)
  • Introduce brand key iteration utility
  • Add example contract test for registry invariants
  • Visual regression via Storybook + Chromatic or Loki
  • Playwright smoke: build + serve + brand root URL assertions
  • Detox minimal mobile navigation test