mocking-strategies

Official

Master Vitest mocking for robust tests.

AuthorMolcajeteAI
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides comprehensive guidance and examples for effectively mocking dependencies in Vitest, ensuring isolated and reliable unit tests.

Core Features & Use Cases

  • Isolate Units: Mock external services, APIs, or modules to focus testing on the unit under test.
  • Create Test Doubles: Utilize vi.fn(), vi.spyOn(), and vi.mock() for stubs, spies, and fakes.
  • Use Case: When testing a function that calls an external API, use this skill's techniques to mock the API response, allowing you to test your function's logic without making actual network requests.

Quick Start

Use the mocking-strategies skill to learn how to mock a function's return value using vi.fn().

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: mocking-strategies
Download link: https://github.com/MolcajeteAI/plugin/archive/main.zip#mocking-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 223,000+ vetted skills library on demand.