vitest

Configure Vitest testing workflows for JavaScript and TypeScript projects.

Updated May 28, 2026
One-click install
npx skills add https://github.com/haryelramalho/skills --skill vitest-haryelramalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/haryelramalho/skills/tree/main/skills/community/vitest
Command: npx skills add https://github.com/haryelramalho/skills --skill vitest-haryelramalho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write, organize, and maintain fast JavaScript and TypeScript tests with Vitest, especially when you need clear guidance on configuration, mocking, coverage, filtering, environments, and project setup.

Core Features & Use Cases

  • Testing Workflow Guidance: Learn how to define tests, suites, hooks, and fixtures with a Jest-compatible API that fits modern Vite-based projects.
  • Mocking and Control: Handle functions, modules, timers, dates, globals, and environment variables for deterministic test behavior.
  • Coverage and CI Readiness: Configure coverage reporting, sharding, filtering, snapshots, and multi-project execution for local development and continuous integration.
  • Use Case: Use this Skill when setting up a new test suite for a web app, debugging flaky async tests, or standardizing a monorepo’s Vitest configuration.

Quick Start

Ask for help configuring Vitest for your project, then specify whether you need test authoring, mocking, coverage, filtering, environments, or monorepo project setup.

Frequently Asked Questions about vitest

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

FAQPage Schema
How do I configure Vitest for unit testing in a Vite-based TypeScript project?

Vitest unit testing configuration uses a Vite-native setup with Jest-compatible APIs, supporting test suites, hooks, and fixtures across JavaScript and TypeScript codebases for fast execution.

What is the best way to mock modules and timers in Vitest tests?

Vitest mocking controls functions, modules, timers, dates, globals, and environment variables to ensure deterministic test behavior in JavaScript and TypeScript unit tests.

Does Vitest work with monorepo and CI testing setups?

Vitest supports monorepo and CI setups through multi-project execution, test sharding, filtering, and coverage reporting for Node, browser-like, and continuous integration environments.

How do I generate coverage reports with Vitest?

Vitest coverage reporting integrates directly into the testing workflow, supporting configuration for local development and CI readiness across JavaScript and TypeScript codebases.

Can I use Vitest if I am migrating from Jest?

Vitest satisfies Jest-compatible APIs for defining tests, suites, hooks, and fixtures, making it suitable for migrating existing JavaScript and TypeScript unit tests to a Vite-native environment.

Why are my Vitest async tests flaky and how do I fix them?

Flaky async tests in Vitest can be resolved by properly configuring mocking for timers, dates, and environment variables to achieve deterministic behavior across test runs.