testing

Organize and validate Vitest tests for unit, integration, and e2e workflows.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/cute-baobao/pm --skill testing-cute-baobao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/cute-baobao/pm/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/cute-baobao/pm --skill testing-cute-baobao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest-based testing for modern JavaScript/TypeScript projects can be confusing without a standardized guide; this Skill provides structured guidance to write, organize, and maintain tests effectively, reducing debugging time and improving coverage.

Core Features & Use Cases

  • Structured test architecture: templates and patterns for unit, integration, and e2e tests with Vitest.
  • Mocking and isolation: best practices for spying, stubbing, and avoiding global mocks.
  • Reference-driven learning: references/ directory holds guides and scenario examples to deepen testing knowledge.

Quick Start

Create a focused Vitest test file for the target module and run it with bunx vitest run --silent='passed-only' for quick feedback.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I structure unit and integration tests with Vitest?

Mocking in Vitest is handled through best practices for spying and stubbing while avoiding global mocks. This ensures test isolation and safe testing practices by preventing cross-test contamination and maintaining consistent testing patterns.

What is the best way to run a focused Vitest test file for quick feedback?

Vitest testing supports web, desktop, and server JavaScript and TypeScript codebases. The structured test architecture applies across these environments, ensuring consistent test organization and safe testing practices regardless of the platform.

Why should I avoid global mocks in JavaScript unit testing?

Avoiding global mocks in JavaScript unit testing prevents test contamination and ensures proper isolation. The approach promotes using local spying and stubbing patterns instead, maintaining safe testing practices through documented principles and consistent behavior.

Are there reference guides available for Vitest testing scenarios?

Reference guides for Vitest testing scenarios are stored in the `references/` directory. These materials provide scenario examples and documented principles to deepen testing knowledge and guide structured test architecture.