test-coverage-improver

Analyze test coverage gaps and generate Jest or Vitest tests for uncovered code.

1|Updated Aug 8, 2026
One-click install
npx skills add https://github.com/th-efool/SKILLS --skill test-coverage-improver-th-efool
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-coverage-improver
Source: https://github.com/th-efool/SKILLS/tree/main/test-coverage-improver
Command: npx skills add https://github.com/th-efool/SKILLS --skill test-coverage-improver-th-efool

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases often ship with untested critical paths, leaving bugs in auth, payments, and error handlers undetected until production. This Skill identifies coverage gaps and provides ready-to-use test templates to close them. ## Core Features & Use Cases - Coverage Gap Analysis: Run coverage reports with Jest, Vitest, or NYC to pinpoint untested lines, branches, and functions. - Test Templates: Generate unit tests, async tests, mocked dependency tests, React component tests, and API route tests. - Branch Coverage Checklist: Systematically cover if/else branches, switch cases, try/catch blocks, early returns, and edge cases. - Use Case: After a coverage report shows 55% line coverage, use this Skill to prioritize critical paths like payment logic, then generate Vitest tests with mocked dependencies until thresholds pass. ## Quick Start Analyze my project's test coverage and write tests for the uncovered critical code paths.

Frequently Asked Questions about test-coverage-improver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check test coverage in a JavaScript project?▼

Run npx jest --coverage for Jest or npx vitest --coverage for Vitest to generate a coverage report. For any other test runner, use npx nyc npm test, then open coverage/lcov-report/index.html to view the HTML report.

What is a good test coverage percentage to target?▼

A minimum of 70% for lines, functions, and statements with 60% branches is acceptable, while 80% lines and 75% branches is considered good. Excellent coverage reaches 90%+ lines and 85%+ branches.

How do I mock dependencies in Vitest tests?▼

Use vi.mock with the module path and a factory returning mocked functions, such as vi.fn().mockResolvedValue for async calls. Call vi.clearAllMocks() in beforeEach to reset mock state between tests.

Does Vitest support coverage thresholds in configuration?▼

Yes, Vitest supports coverage thresholds in vitest.config.ts under test.coverage.thresholds, where you set minimums for lines, branches, functions, and statements. Use the v8 provider with text, html, and lcov reporters.

Which code should I test first when coverage is low?▼

Prioritize critical paths like auth, payments, and data mutations first, then complex logic such as algorithms and state machines. Follow with error handlers, edge cases like empty arrays and null values, and integration points.