- π 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.
- Clone the repo
- Run
yarn
to install dependencies - Run
yarn test:unit
to run the unit tests - Run
yarn test:unit:dev
to run the unit tests in dev/watch mode - Run
yarn test:unit:coverage
to run the tests and generate a coverage report - Run
yarn test:e2e
to run the e2e tests - Run
yarn test:e2e:dev
to run the e2e tests in dev/watch mode - Run
yarn test:e2e:record
to run the e2e tests and record a video of the tests
- Clone the repo
- Run
yarn
to install dependencies - Run
npx pod-install
to install iOS dependencies - Run
yarn start
to start the metro bundler - Click
i
to run the app on iOS simulator ora
to run it on Android emulator
- βοΈ Add tests for react native web project
- π A blog by Steve Galili on "Where and How to Start Testing Your React Native App"
- π Inspired by Kent C. Dodds' workshop Test React Components with Jest and React Testing Library. For more info check Epic React.
- π React Native Testing Library
- π§βπ¬οΈ Jest
- οΈβοΈ React Native
- πΊ React Navigation
- π° MSW