This is how you should test 🧪 your react-native ⚛️ components with Jest and React Native Testing Library
👏 Inspired by Kent C. Dodds' workshop Test React Components with Jest and React Testing Library. For more info check Epic React
In this repo you'll find several examples that will cover:
- 👆 Clicking buttons and asserting onPress' outcome.
- 📲 Filling a simple login form and asserting successful submission.
- 🎣 Custom hook testing (number of alternatives).
- 📡 Mocking fetch calls.
- 🧭 Mocking navigation through screens. (react navigation v5)
- 🔚 E2E feel due to real navigation throughout screens.
- 📥 Handling and mocking providers.
- 📹 Mocking external lib.'s components.
- 🎭 Mocking and interacting with RN's Modal component.
- 🧾 Handling with a screen with RN's FlatList component.