08 testing and quality
Unit Testing Guide
Practical notes for writing Jest + RTL tests in the VibeFast monorepo.
Where the tests live
- Expo/React Native components ship tests in
apps/native/src/**/__tests__next to the implementation. - Convex helpers and actions are tested via Vitest inside
packages/backend/convex. - Shared helpers live under
apps/native/src/lib/test-utilsand wrap the Convex provider, theme, and navigation so your tests stay focused on real interactions.
How to add a test
- Copy the component to test and drop a sibling
__tests__/<component>.test.tsxfile. - Render the component via the shared
setuphelper (it injects providers, theming, and navigation). Usescreen+userfrom@testing-library/react-nativeto interact with the UI. - Assert only observable behavior (labels, button presses), not internal state. The goal is to prove the user sees the right thing and the right callbacks fire.
- Run
pnpm test:frontendto verify your test before committing.
Found an issue or bug in the docs?
Help me improve! If you spot any errors, typos, or have suggestions, please let me know.
Reach out on X/Twitter @zafarbuildzz