tech-vitest

Official

Vitest utilities for robust, mock-friendly tests.

Authorravnhq
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides standardized Vitest-based testing utilities, mocks, and assertion patterns to help teams write reliable, maintainable tests without bespoke, ad-hoc setups.

Core Features & Use Cases

  • Mocking utilities: Use vi.fn, vi.mock, and vi.spyOn to simulate dependencies while preserving real behavior when needed.
  • Assertions patterns: Apply Vitest expect matchers for precise, readable test failures.
  • Lifecycle hooks & timers: Employ beforeEach/afterEach and vi.useFakeTimers to ensure deterministic test execution.
  • MSW integration: Seamlessly mock external HTTP calls with MSW to validate network paths without real services.
  • Use Case: Write unit tests for a UI component that fetches data, mock API responses, and verify UI state transitions.

Quick Start

Install Vitest in your project, then start writing tests using vi.fn/vi.mock and the Vitest patterns described in this Skill.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 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: tech-vitest
Download link: https://github.com/ravnhq/ai-toolkit/archive/main.zip#tech-vitest

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.