Cheatsheet — Jest
Mocking
- Mock Library methods
2. Partially Mock Library Methods
3. Partially Mock Own methods Approach 1
4. Partially Mock Own methods Approach 2
DOM Testing
- Shallow Testing with Enzyme
2. Deep testing with Enzyme
3. DOM Testing with react-native-testing-library
react-native-testing-library
Coverage Report
- Generate coverage report in watch mode for all files
yarn testCoverage --watchAll
2. Generate coverage report in watch mode for updated files
yarn testCoverage --changedSince=dev --watch
3. Generate coverage report in watch mode for a particular file
yarn testCoverage src/feature/dashboard/DashboardScreen.test.tex --watchAll