Jest and React Native Testing Library
This is how you should test π§ͺ your react-native βοΈ components withKent C. Dodds' workshop Test React Components with Jest and React Testing Library. For more info check Epic React
π Inspired byIn 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.
- π‘ Using MSW to mock api calls and handling loading/errors.