vitest-testing-expert

Configures, migrates, and optimizes Vitest test suites for Vite projects.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill vitest-testing-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest-testing-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/vitest-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill vitest-testing-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up and maintaining Vitest test suites involves tricky configuration choices, Jest migration pitfalls, browser mode setup, and performance tuning that slow down development teams. ## Core Features & Use Cases - Jest to Vitest Migration: Converts jest.mock patterns, type imports, snapshot formats, and timeout configurations to Vitest equivalents. - Browser Mode Testing: Configures multi-browser testing with Playwright or WebDriver for React, Vue, Angular, and Solid components. - Performance Optimization: Tunes pool configuration, isolation, dependency optimization, and reporter output for faster test execution. - Use Case: A team migrating a monorepo from Jest to Vitest uses this Skill to convert mock patterns, set up multi-project workspace configuration, and reduce test execution time through pool tuning. ## Quick Start Ask the agent to review your vitest.config.ts and migrate your existing Jest test files to Vitest with optimized performance settings.

Frequently Asked Questions about vitest-testing-expert

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

FAQPage Schema
How do I migrate from Jest to Vitest?

Replace jest.mock with vi.mock imported from 'vitest', update type imports from the Jest namespace, and enable globals: true for easier transition. Note that mockReset in Vitest restores the original implementation rather than returning an empty function.

How to set up Vitest browser mode testing?

Install @vitest/browser plus playwright or webdriverio, then enable browser mode in your config with instances specifying browsers like chromium. Import page and commands from '@vitest/browser/context' for DOM interactions.

Vitest vs Jest for Vite projects?

Vitest integrates natively with Vite's configuration and transform pipeline, offering native ESM support and faster execution through dependency optimization. Jest requires separate transformation setup and lacks direct Vite integration.

Why are my Vitest tests running slowly?

Slow tests usually stem from suboptimal pool configuration, unnecessary isolation, or unoptimized dependencies. Try adjusting pool options, disabling isolation when tests lack side effects, and enabling deps.optimizer for web and ssr.

Does Vitest support TypeScript and ESM modules?

Yes, Vitest provides native ESM support without transformation overhead and built-in TypeScript handling. Add Vitest types to your tsconfig and use import.meta.vitest for in-source testing.

Why is jest.mock not a function in my Vitest tests?

This error occurs when Jest API calls remain after migration. Replace jest.mock with vi.mock and import vi from 'vitest', since Vitest does not inject Jest globals by default.