frontend-unit-test-coverage

Analyze Jest or Vitest coverage reports and implement unit tests for Pinia stores, composables, and UI components.

1|Updated Sep 6, 2024
One-click install
npx skills add https://github.com/carlos18bp/gym_project --skill frontend-unit-test-coverage-carlos18bp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-unit-test-coverage
Source: https://github.com/carlos18bp/gym_project/tree/main/.agents/skills/frontend-unit-test-coverage
Command: npx skills add https://github.com/carlos18bp/gym_project --skill frontend-unit-test-coverage-carlos18bp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams fix low-quality frontend coverage by systematically analyzing coverage reports and implementing targeted unit tests that improve statement and branch coverage.

Core Features & Use Cases

  • Coverage-driven test creation: Review coverage output and prioritize the lowest-coverage files in a clear order (stores first, then shared logic, then critical UI components).
  • Deterministic, CI-friendly testing rules: Enforce batch limits, command batching, fake-timer hygiene, and clean localStorage between tests.
  • Actionable reporting format: Produce a structured coverage delta report per file and execution results to track progress toward 100% coverage.

Quick Start

Ask the AI to review your current frontend coverage report and generate the next set of Jest/Vitest tests to reach 100% coverage, following the project’s testing quality standards.

Frequently Asked Questions about frontend-unit-test-coverage

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

FAQPage Schema
How do I increase Jest or Vitest statement and branch coverage in my frontend project?

To increase Jest or Vitest statement and branch coverage, you can analyze existing coverage reports and implement targeted unit tests for Pinia stores, composables, and UI components. This approach systematically prioritizes the lowest-coverage files to push overall coverage toward 100%.

What is the best way to write unit tests for Pinia stores and composables?

The best way to write unit tests for Pinia stores and composables is by following deterministic, CI-friendly practices. This includes enforcing batch limits, applying fake-timer hygiene, and cleaning localStorage between tests to ensure reliable execution and accurate coverage tracking.

Does this frontend testing approach work with both Jest and Vitest?

Yes, this frontend testing approach works with both Jest and Vitest. It analyzes coverage reports generated by either framework and implements new tests for critical frontend files, ensuring compatibility with your existing testing setup and CI pipelines.

How do I track frontend test coverage progress across multiple files?

You track frontend test coverage progress by generating a structured coverage delta report per file. This actionable reporting format displays coverage metrics before and after test implementation, alongside the exact test command run, to monitor progress toward 100% coverage.

Why are my frontend unit tests failing in CI due to timer or localStorage issues?

Frontend unit tests often fail in CI due to timer or localStorage issues when test hygiene is neglected. Applying fake-timer hygiene and cleaning localStorage between tests ensures deterministic execution, preventing flaky test failures across critical frontend files.