Code coverage shows which lines your tests execute:
jest --coverage
Coverage reports show:
- Lines: Percentage of lines executed
- Branches: Percentage of if/else branches tested
- Functions: Percentage of functions called
Aim for high coverage, but don't chase %. Focus on testing logic, not every line.