Vitest Config Generator

Generate Vitest configuration files instantly. Customize test environment, coverage, TypeScript, aliases, and more. Export as TS, JS, or MJS.

Coverage Settings
Module Settings

Enter alias mappings, one per line (e.g. @/components => ./src/components)

Test Options

Test file patterns, one per line

Patterns to exclude from test discovery

About Vitest Config Generator

Vitest is a blazing fast unit test framework powered by Vite. It provides out-of-the-box support for TypeScript, JSX, and ESM, with instant feedback and intelligent watch mode. This generator creates ready-to-use Vitest configuration files tailored to your project type, saving you time and reducing setup friction. All generation happens client-side — no data is sent to any server.

Features

How to Use

  1. Select your project preset (React, Vue, TypeScript, etc.)
  2. Choose your preferred config format (TypeScript recommended)
  3. Configure test environment, coverage, and module settings
  4. Toggle advanced options like globals, UI mode, and type checking
  5. Click "Generate Config" to create your configuration
  6. Copy or download the config, then run the install command

Common Use Cases

Frequently Asked Questions

What is Vitest?

Vitest is a fast Vite-powered unit testing framework. It offers instant feedback, intelligent watch mode, and native ESM support, making it a popular alternative to Jest for Vite-based projects.

Should I choose v8 or istanbul for coverage?

v8 is faster and uses native Chrome coverage, but may be less accurate in some edge cases. istanbul is the traditional standard with broader ecosystem support. For most projects, v8 is sufficient and faster.

What is the difference between jsdom and happy-dom?

jsdom is the standard browser environment emulator used by Jest. happy-dom is a lighter, faster alternative that implements many browser APIs with better performance. Choose happy-dom for speed, jsdom for maximum compatibility.

Should I enable globals?

Enabling globals lets you use describe, it, expect without importing them. This matches Jest behavior and is convenient, but explicit imports are recommended for better TypeScript support and clarity.

What test pool should I use?

threads (default) runs tests in worker threads with good performance. forks creates isolated Node.js processes for maximum isolation. vmThreads uses VM contexts (experimental). Use threads for most projects, forks if you encounter module isolation issues.

How do I migrate from Jest to Vitest?

Select your project preset, enable globals for Jest-compatible API, and choose the same test environment (jsdom/node). Most Jest APIs are compatible with Vitest. Update your package.json scripts to use vitest instead of jest.

Does Vitest support TypeScript out of the box?

Yes! Vitest has native TypeScript support without requiring ts-jest or babel-jest. Just use .ts or .tsx test files and Vitest handles compilation automatically via Vite.

Can I use Vitest without Vite?

Yes, Vitest can be used independently of Vite. It uses Vite under the hood but works with any project. However, it shines brightest when paired with Vite for the most seamless experience.

Related Tools