Add focused tests until coverage target met (default 80%).
Start the "Coverage Until Threshold" loop. - Goal: Test coverage meets the target threshold (default 80%) with all tests passing. - Max iterations: 12 - Between iterations run: `npm test -- --coverage` - Exit when: coverage percentage meets or exceeds the threshold AND all tests pass. Steps: 1. Run the test suite with coverage reporting 2. If threshold is met, stop — exit condition met 3. Identify the file/module with the largest coverage gap (lowest coverage, most uncovered lines) 4. Write focused tests for the uncovered paths — prioritize: error handling, edge cases, branching logic 5. Do not change production code to increase coverage — only add tests 6. Run tests to verify the new tests pass and coverage improved 7. Repeat, targeting the next largest gap Self-pacing instructions: After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when exit condition passes or max iterations reached. Give a short status update each pass.
How it works