vitest

Guide Vitest testing conventions for JavaScript and TypeScript projects.

19|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/xobotyi/cc-foundry --skill vitest-xobotyi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/xobotyi/cc-foundry/tree/main/plugins/javascript/skills/vitest
Command: npx skills add https://github.com/xobotyi/cc-foundry --skill vitest-xobotyi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive framework and best practices for writing efficient and maintainable tests using the Vitest testing framework, ensuring code quality and robustness.

Core Features & Use Cases

  • Vitest Conventions: Enforces best practices for test structure, mocking, and assertions.
  • Configuration Guidance: Offers insights into configuring Vitest for optimal performance and specific project needs.
  • Migration Support: Assists in migrating from Jest to Vitest.
  • Use Case: When developing a new feature, use this Skill to write unit and integration tests that adhere to Vitest's conventions, ensuring they are fast, reliable, and easy to understand.

Quick Start

Use the vitest skill to write a new unit test for the calculateTotal function.

Frequently Asked Questions about vitest

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

FAQPage Schema
How do I write unit tests in Vitest for a TypeScript project?

To write unit tests in Vitest, you define test structures using its specific conventions and assertion APIs. This framework provides guidance for structuring tests and applying mocking strategies to ensure your JavaScript and TypeScript code is reliable and maintainable.

Can I use Vitest for migrating existing Jest tests?

Yes, Vitest supports migrating existing Jest tests. The framework provides specific migration support and best practices to help you transition your testing suite while maintaining test reliability and speed.

What's the best way to configure Vitest for optimal performance?

The best way to configure Vitest is by applying the framework's provided configuration guidance and best practices. This ensures your test suite runs efficiently and is tailored to your specific project needs for fast execution.

How does mocking work in Vitest testing?

Mocking in Vitest works by applying the framework's established mocking strategies and conventions. This allows you to isolate units of code during testing, ensuring your tests remain fast, reliable, and easy to understand.

Are there specific assertion APIs I should use in Vitest?

Yes, Vitest provides specific assertion APIs designed for writing tests. Using these built-in assertions alongside the framework's conventions ensures your test logic is robust and accurately validates application behavior.