bun test # Jest once (via package.json → jest)
bun run test:watch # Watch mode
bun verify # lint + tsc + tsc:app + testverify is the gate to run before opening a PR or cutting a release candidate.
Essential coverage only — controllers, storage, CDN helpers, and a few smoke locks. Do not grow a full screen / UI matrix. jest.config.js keeps a minimal suite (no coverage gates), same idea as the website’s small src/tests/**.
Prefer:
- Pure helpers (
formatConfig,assetUrl/ markdown,oxyApi) - Boot (
contentController) - OTA / store-update helpers (
updatesController,storeVersion,storeUpdateController) - Thin smokes (
App, splash brand, Satsang headings)
Avoid brittle layout snapshots and one test per component.
lint— ESLint on JS/TS.tsc— full TypeScript project check.tsc:app— app-focused project (tsconfig.no-tests.json) without relying on test files for type health.test— Jest viajest-expo.
Current layout: src/tests/.
| Area | Typical files |
|---|---|
| Store / boot | contentController.test.ts, navbarSlice.test.ts |
| OTA / store update | updatesController.test.ts, storeVersion.test.ts, storeUpdateController.test.ts |
| Network / storage | oxyApi.test.ts (mock fetch), asyncStorage.test.ts |
| Config / markdown | formatConfig.test.ts (includes sectionsFromMarkdown) |
| Logging | logger.test.ts |
| UI smoke | App.test.tsx, CustomSplashScreen.test.tsx, SatsangScreen.test.tsx |
| Theme / nav types | theme.test.ts, navTypes.test.ts (tabs + donation stack route) |
SVG and awkward native modules are stubbed under src/tests/__mocks__/ and jest.setup.js as needed.
- Prefer pure helpers and controllers over full-app snapshots.
- Add a screen test only when it locks an essential product invariant (e.g. CDN section headings render).
- Network tests mock
global.fetch— there is no axios client. - When mocking Expo modules, prefer
jest.requireActualplus a narrow override — incompleteexpo-modules-coremocks break the suite. - Keep product code out of
src/tests/; only tests and mocks belong there.
GitHub Actions: .github/workflows/ci.yml runs on pushes and PRs to main / develop.
| Job | Command | Blocking |
|---|---|---|
| Lint, typecheck & tests | bun install --frozen-lockfile then bun verify |
Yes |
| Dependency audit | bun audit |
No (continue-on-error) |
Locally, green bun verify is the same gate. Native builds (android / ios / EAS) are separate from this workflow.