React Native interview question · Most asked
How do you test a React Native app?
Summary
Unit-test pure logic with Jest (jest-expo preset), test components with React Native Testing Library by interacting like a user and asserting on visible output, and cover a few critical flows end to end with Maestro or Detox on real builds.
Longer Answer
Query by role, label and text rather than implementation details. Mock network and native modules at the edges. Keep end-to-end tests few and stable (sign-in, purchase), and run all tests in CI.
Key Points
- Jest for logic.
- RNTL for components, user-centric queries.
- Maestro/Detox for critical flows.
More most-asked React Native questions
- What is React Native, and how does it differ from a hybrid (WebView) app?
- Explain the React Native threading model.
- What is the React Native New Architecture?
- When would you use FlatList instead of ScrollView, and how do you make long lists fast?
- Where should you store data on the device, and what should never go in AsyncStorage?
- How would you make a React Native app work offline?
- How do you handle authentication tokens in a mobile app?
- A screen in your React Native app is slow. How do you investigate and fix it?