testing-coverage

Enforce 95% test coverage with Vitest in browser mode.

2|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/ferryhinardi/supertool --skill testing-coverage-ferryhinardi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-coverage
Source: https://github.com/ferryhinardi/supertool/tree/main/.github/skills/testing-coverage
Command: npx skills add https://github.com/ferryhinardi/supertool --skill testing-coverage-ferryhinardi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides teams to consistently achieve mandatory 95% test coverage across lines, functions, branches, and statements using Vitest in browser mode, reducing regressions and improving code quality.

Core Features & Use Cases

  • Enforces high coverage: ensures all code paths meet the 95% threshold across languages and modules.
  • Vitest in browser mode: supports browser-based testing workflows for UI components.
  • Practical guidance: shows setup, running, and troubleshooting steps for tricky test scenarios in common repo structures (app/, hooks/, lib/).

Quick Start

Use the skill to kick off a coverage-focused test run with a simple command sequence:

  • Run tests with coverage enabled: CI=true pnpm test run --coverage
  • Run local UI/browser tests: CI=true pnpm test:browser
  • Open coverage report in browser (path may vary): open coverage/index.html

Frequently Asked Questions about testing-coverage

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

FAQPage Schema
How do I enforce a 95% test coverage threshold across my repository using Vitest?

To enforce 95% test coverage with Vitest, configure your test runs to fail when lines, functions, branches, or statements drop below the threshold. Use `CI=true pnpm test run --coverage` to validate these metrics across project directories.

How does Vitest browser mode work for UI component testing?

Vitest browser mode executes UI component tests directly in a browser environment to validate interactions. You can trigger these local browser tests using the `CI=true pnpm test:browser` command sequence.

Do I need a specific project structure to run Vitest coverage reports?

No specific structure is required, but the workflow supports typical layouts like `app/`, `hooks/`, and `lib/` directories. You need a Vitest configuration and a browser runner configured to execute tests and generate the coverage reports.

What is the best way to view Vitest coverage results locally?

The best way to view Vitest coverage results locally is to open the generated HTML report in your browser. After running tests with coverage enabled, execute `open coverage/index.html` to inspect the detailed metrics.

Why does my test coverage fail in CI even though local tests pass?

Test coverage fails in CI when code paths across lines, functions, branches, or statements drop below the 95% threshold. Ensure your CI environment runs tests with coverage enabled and applies the same strict thresholds as your local configuration.