vitest-testing-strategies

Community

Write stable, robust tests with Vitest.

Authormasakinihirota
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses common challenges in testing JavaScript applications, particularly with Vitest and React Testing Library, by providing strategies for stable mocking, integration testing, and accessibility checks.

Core Features & Use Cases

  • Effective Mocking: Differentiates between vi.spyOn and vi.mock for precise control over module and object mocking.
  • Integration Testing: Implements the Arrange-Act-Assert (AAA) pattern for clear and maintainable tests.
  • Dependency Handling: Guides on mocking external services like Supabase at the boundaries.
  • Accessibility: Integrates vitest-axe for automated accessibility testing.
  • Use Case: Ensure your React components are thoroughly tested for functionality, correct API interactions, and accessibility compliance using Vitest.

Quick Start

Use the vitest-testing-strategies skill to refactor the current test suite to implement the AAA pattern and improve mocking of localStorage.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: vitest-testing-strategies
Download link: https://github.com/masakinihirota/vns-masakinihirota/archive/main.zip#vitest-testing-strategies

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.