Release, monitoring and testing · mid
Testing React Native apps: Jest, RNTL, Detox and Maestro
Test logic with Jest, screens with React Native Testing Library by what the user sees (roles, text) with native modules mocked, and a few critical journeys end to end with Detox (grey-box, waits until the app is idle) or Maestro (black-box YAML flows) on release builds.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Unit: reducers, hooks, utilities and formatters with Jest. Since 0.85 the preset is "@react-native/jest-preset".
- Integration: RNTL render + screen queries (getByRole, getByText, findBy… for async) + userEvent or fireEvent. RNTL 14 (Jun 2026; React 19 and RN 0.78+) made render, fireEvent and act async, so you await them.
- Mock native modules (jest.mock) and the network (MSW or a mocked API module). Use fake timers for debounce and advance them inside act.
- E2E: Detox (JS tests; waits for the app to be idle: network, timers, animations) vs Maestro (YAML flows in .maestro/, black-box, handles system dialogs and WebViews, quick to write). EAS Workflows has maestro jobs.
- Keep E2E to a few critical paths (login, checkout, payment) on release builds. Flakiness comes from timing, animations, shared state and test data.
- Do not test implementation details (state values); assert what the user sees.
The red pen
Common traps: mistake → fix
Mistake: "Snapshot tests are our strategy"
Fix: they break on any change and check little behaviour.
Mistake: "render() is synchronous in RNTL"
Fix: since v14 you must await render and fireEvent.
Mistake: "E2E-test everything"
Fix: slow and flaky; keep E2E for critical journeys.
Easy to hard
Questions interviewers ask, easy to hard
- What belongs in unit, integration and E2E tests for a React Native app?
- Detox or Maestro, and why?
- Write a test: typing "p", "pi", "piz" quickly calls the search API once, with "piz".
- Your E2E suite is flaky. What causes it and how do you fix it?
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.