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.