vitest

Run Vite-powered unit tests for JavaScript and TypeScript projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest reduces slow, brittle, and hard-to-configure test workflows by providing a Vite-powered test runner that runs tests quickly with native ESM and TypeScript support and a familiar Jest-like API.

Core Features & Use Cases

  • Vite-native performance: Leverages Vite's transform pipeline and plugins for fast test execution and HMR-like updates during development.
  • Jest-compatible API: Provides test, describe, expect, and vi mocking utilities so existing Jest suites can be migrated with minimal changes.
  • TypeScript and ESM first: Supports native ESM, TypeScript, and JSX without additional bundling steps.
  • Mocking, fixtures, and hooks: vi mocking utilities, test.extend fixtures, and lifecycle/around hooks for robust setup and teardown patterns.
  • Coverage, snapshots, and filtering: Built-in coverage (V8 or Istanbul), snapshot testing, test filtering, sharding, and concurrent execution for CI and large monorepos.
  • Use Case: Run unit and integration tests in a Vite-based frontend project, mock network calls, run type-only checks, and collect coverage reports in CI.

Quick Start

Run vitest to execute the project's tests with coverage enabled and use jsdom for browser-like tests.

Frequently Asked Questions about vitest

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

FAQPage Schema
How do I run fast unit tests for a Vite project with native TypeScript support?▼

You can run fast unit tests for a Vite project using a Vite-powered test runner that provides native ESM and TypeScript support without additional bundling steps. It leverages Vite's transform pipeline for quick execution and HMR-like updates.

Can I migrate my existing Jest test suites to Vite with minimal configuration changes?▼

Yes, you can migrate existing Jest test suites to Vite using a Jest-compatible API that provides test, describe, expect, and vi mocking utilities, allowing you to transition your tests with minimal changes required.

How do I mock network calls and collect code coverage reports in continuous integration?▼

You can mock network calls using vi mocking utilities and collect code coverage reports in continuous integration by utilizing built-in V8 or Istanbul coverage providers, snapshot testing, and test sharding for large monorepos.

Does Vite-native testing work with Jest-compatible APIs for TypeScript and ESM projects?▼

Yes, Vite-native testing works with Jest-compatible APIs for TypeScript and ESM projects by supporting native ESM, TypeScript, and JSX out of the box. It uses multi-threaded workers and smart watch mode for efficient test execution.

What is the best way to execute browser-like tests in a Vite-based frontend application?▼

The best way to execute browser-like tests in a Vite-based frontend application is to run the Vite-powered test runner configured with jsdom. This allows you to apply unit, integration, and snapshot testing workflows efficiently.

How do I handle setup and teardown patterns in TypeScript testing using fixtures and hooks?▼

You handle setup and teardown patterns in TypeScript testing by using test.extend fixtures alongside lifecycle and around hooks. These utilities provide robust management for test environments and mocking scenarios.