vitest

Run Jest-compatible unit tests for Vite projects with TypeScript and ESM.

117|11|Updated Aug 19, 2025
One-click install
npx skills add https://github.com/bskimball/tanstack-hono --skill vitest-bskimball
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/bskimball/tanstack-hono/tree/main/.agents/skills/vitest
Command: npx skills add https://github.com/bskimball/tanstack-hono --skill vitest-bskimball

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest provides fast, reliable unit testing for Vite-based projects with a Jest-compatible API, enabling quick feedback during development.

Core Features & Use Cases

  • Jest-compatible API with native ESM and TypeScript support
  • Vite-integrated test runner with fast, incremental tests and watch mode
  • Built-in coverage, snapshots, and fixtures for robust testing
  • Suitable for client and server codebases, multi-project setups, and CI
  • Use cases include unit tests, mocking, and test-driven development
  • Use Case: teams can ship features faster by validating code with instant feedback

Quick Start

Install Vitest and run tests to start validating your codebase immediately.

Frequently Asked Questions about vitest

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

FAQPage Schema
How do I set up unit testing for a Vite project with TypeScript?

Unit testing for a Vite project uses Vitest to provide a Jest-compatible API with native ESM and TypeScript support. You can validate client and server codebases immediately by installing Vitest and running tests with built-in watch mode.

What is the best way to mock modules in native ESM unit tests?

Mocking modules in native ESM unit tests is handled natively by Vitest. It provides built-in mocking support alongside fixtures and snapshots, enabling robust test-driven development without requiring additional external mocking libraries.

Can I use a Jest-compatible API for testing Vite-powered applications?

Yes, you can use a Jest-compatible API for testing Vite-powered applications because Vitest is specifically designed to provide this compatibility. It integrates directly with Vite to offer fast, incremental tests while maintaining familiar Jest syntax.

Does Vitest support multi-project configurations and concurrent tests?

Vitest fully supports multi-project configurations and concurrent tests within Vite-based setups. It provides config-driven test environments that satisfy type safety and tooling integration across both client and server codebases.

How do I generate code coverage for TypeScript and JSX in Vite?

You generate code coverage for TypeScript and JSX in Vite using Vitest's built-in coverage tools. It automatically handles TypeScript and JSX transpilation across client and server code, providing coverage reports without needing separate instrumentation plugins.