frontend-testing

Provide Vitest testing patterns for the SmartPocket React app.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/chinomartinez/SmartPocket --skill frontend-testing-chinomartinez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-testing
Source: https://github.com/chinomartinez/SmartPocket/tree/main/.agents/skills/frontend-testing
Command: npx skills add https://github.com/chinomartinez/SmartPocket --skill frontend-testing-chinomartinez

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Este conjunto de patrones de testing con Vitest facilita escribir pruebas consistentes en la app React de SmartPocket, incluyendo mocks de servicios, pruebas de hooks y organización de tests, así como métodos para medir cobertura y configurar CI.

Core Features & Use Cases

  • Prácticas de co-localización de tests junto al código fuente con sufijo .test.ts(x), evitando carpetas tests.
  • Patrones universales de mocking para servicios, hooks y componentes, con pautas para TanStack Query y bibliotecas de toast.
  • Guía de pruebas para unitarias, de integración y pruebas de UI, con objetivos de cobertura y ejemplos reutilizables.
  • Ejemplos y plantillas que aceleran la escritura de tests y mantienen una estructura mantenible.

Quick Start

Run npm run test:coverage to generate and review the test coverage.

Frequently Asked Questions about frontend-testing

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

FAQPage Schema
How do I set up Vitest testing patterns for a React app?

Vitest testing patterns for a React app are set up by co-locating tests with source code using a .test.ts(x) suffix. This approach organizes unit, integration, and hook tests while avoiding separate __tests__ folders for maintainable structure.

What is the best way to mock TanStack Query and toast libraries in Vitest?

The best way to mock TanStack Query and toast libraries in Vitest involves applying universal mocking patterns for services and hooks. This Skill provides specific guidelines for mocking these libraries to ensure consistent UI and integration test execution.

How do I measure test coverage and configure CI for front-end testing workflows?

You measure test coverage and configure CI for front-end testing workflows by running npm run test:coverage. This command generates coverage reports to review, satisfying the configuration needs for continuous integration environments.

Can I use co-located testing patterns for both unit and integration tests?

Yes, you can use co-located testing patterns for both unit and integration tests. The Skill provides structured guidance covering UI, integration, and hook testing with reusable examples that accelerate writing tests for React components.

Why should I avoid __tests__ folders when organizing Vitest tests?

You should avoid __tests__ folders when organizing Vitest tests to maintain a co-located structure. Placing files with a .test.ts(x) suffix directly next to source code improves maintainability and speeds up test writing for React applications.

Does this Skill provide templates for testing React hooks?

Yes, this Skill provides templates and examples for testing React hooks. It includes structured Vitest-based patterns specifically designed for hook testing, alongside service mocking and UI testing guidelines for the SmartPocket React app.