vitest-test-development

Write Vitest unit and integration tests for Node.js/Fastify applications.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/thermiteau/claude-vps --skill vitest-test-development
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vitest-test-development
Source: https://github.com/thermiteau/claude-vps/tree/main/src/skills/vitest-test-development
Command: npx skills add https://github.com/thermiteau/claude-vps --skill vitest-test-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for writing effective unit and integration tests using Vitest, ensuring code quality and reliability without unnecessary complexity.

Core Features & Use Cases

  • Focus on Value: Prioritizes tests that catch real bugs in business logic, data transformations, and API endpoints.
  • Avoids Pitfalls: Discourages testing third-party libraries, framework internals, or superficial code.
  • Use Case: When developing a new API endpoint, use this Skill's guidance to write robust integration tests that verify request handling, data persistence, and error responses, rather than just testing the web framework itself.

Quick Start

Follow the guidelines in this skill to write Vitest unit tests for your business logic.

Frequently Asked Questions about vitest-test-development

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

FAQPage Schema
How do I write high-value Vitest unit tests for business logic?▼

To write high-value Vitest unit tests, focus on testing business logic and data transformations while avoiding superficial tests. Prioritize verifying actual application behavior to catch real bugs rather than testing framework internals or third-party libraries.

What is the best way to test Fastify API endpoints with Vitest?▼

The best way to test Fastify API endpoints with Vitest is writing robust integration tests. Verify request handling, data persistence, and error responses to ensure endpoint reliability without testing the web framework itself.

When should I use vi.mock, vi.fn, and vi.spyOn in Vitest?▼

Use Vitest mocking utilities like vi.mock, vi.fn, and vi.spyOn to isolate business logic and API endpoints during testing. Employ them to replace dependencies without over-mocking third-party libraries or framework functionality.

Why should I avoid over-mocking third-party libraries in integration testing?▼

Over-mocking third-party libraries in integration testing reduces test value by validating the mock instead of real behavior. Focus tests on your own business logic, data transformations, and API endpoints to catch actual bugs effectively.

Does this Vitest testing guidance apply to Node.js database operations?▼

Yes, this Vitest testing guidance applies to Node.js database operations by providing comprehensive guidelines for testing data persistence. It ensures reliability without unnecessary complexity by focusing on real business logic outcomes.