What problem does it solve?
This Skill helps developers configure, run, and analyze code coverage reports generated by Jest, ensuring comprehensive testing and identifying areas needing more test coverage.
Core Features & Use Cases
- Jest Configuration: Provides examples for
jest.config.js to enable coverage collection, define reporters, and set thresholds.
- Running Coverage: Demonstrates CLI commands and
package.json scripts for executing Jest with coverage.
- Improving Coverage: Offers strategies for identifying and fixing coverage gaps, focusing on branch coverage and edge cases.
- Use Case: A developer wants to ensure their new feature branch meets the team's 80% line coverage requirement before merging. They use this Skill to configure Jest, run coverage, and identify which lines are not being tested.
Quick Start
Configure your Jest project to collect code coverage by adding collectCoverage: true to your jest.config.js file.