vitest

Implement Vitest unit and integration tests with Jest-compatible APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest helps developers run reliable unit tests quickly in modern projects, reducing slow feedback loops and improving consistency with Jest-style APIs.

Core Features & Use Cases

  • Vite-powered test execution: Uses Vite’s transformation pipeline for fast reruns and consistent module handling.
  • Jest-compatible API: Write tests with familiar test/it, describe/suite, and Jest-style matchers via expect.
  • Built-in mocking and utilities: Use vi for mocking, spying, fake timers, and environment/global stubbing.
  • Advanced testing patterns: Support concurrency (test.concurrent), filtering (--tags, name/file patterns), projects/workspaces, and sharding-friendly workflows.
  • Coverage and snapshots: Generate code coverage reports and use snapshot testing (inline, file, and file snapshots).

Quick Start

Ask the AI to generate a Vitest unit test that uses a mocked module with vi.mock and asserts behavior with expect.

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 for a Vite project using a Jest-compatible API?

You can write unit tests for a Vite project using Vitest, which provides Jest-compatible `test`, `describe`, and `expect` ergonomics while natively leveraging Vite's transformation pipeline for fast reruns and consistent module handling.

What is the best way to mock modules and control timers in JavaScript unit tests?

The best way to mock modules and control timers is using Vitest's built-in `vi` utilities, which provide deterministic mocking, spying, fake timers, and environment stubbing for your JavaScript and TypeScript test suites.

Can I use snapshot testing and code coverage reporting with Vite-native transforms?

Yes, Vitest supports Vite-native transforms alongside built-in code coverage reporting and snapshot testing, allowing you to utilize inline, file, and file snapshots to track component output changes.

Does Vitest support concurrency and filtering for large test suites?

Vitest supports concurrency through `test.concurrent` and provides filtering capabilities using `--tags`, name patterns, and file patterns to manage large test suites effectively.

How do I configure multiple test environments in a monorepo project?

You can configure multiple test environments in a monorepo using Vitest's projects and workspaces support, which allows sharding-friendly workflows and configurable environments across different packages.