vitest-config-generator
Generate Vitest configuration files for fast unit testing of JavaScript/TypeScript projects. Triggers on "create vitest config", "generate vitest configuration", "vitest setup", "unit test config".
When & Why to Use This Skill
The Vitest Config Generator is a specialized Claude skill designed to automate the creation of Vitest configuration files for JavaScript and TypeScript projects. It streamlines the testing setup process by generating production-ready vitest.config.ts files, including essential settings for test environments like JSDOM, code coverage reporting, and global variables, ensuring a fast and reliable foundation for unit and integration testing.
Use Cases
- Case 1: Initializing a new React or Vue project and needing an immediate, best-practice Vitest configuration to start writing tests.
- Case 2: Configuring automated code coverage reports to monitor and improve software quality within a TypeScript codebase.
- Case 3: Setting up a JSDOM environment for browser-based component testing without manually researching configuration syntax.
- Case 4: Migrating a project's testing suite from Jest to Vitest and requiring a quick boilerplate setup to ensure compatibility.
| name | vitest-config-generator |
|---|---|
| description | Generate Vitest configuration files for fast unit testing of JavaScript/TypeScript projects. Triggers on "create vitest config", "generate vitest configuration", "vitest setup", "unit test config". |
Vitest Config Generator
Generate Vitest configuration files for fast unit and integration testing.
Output Requirements
File Output: vitest.config.ts
Format: Valid Vitest configuration
Standards: Vitest 1.x
When Invoked
Immediately generate a complete Vitest configuration with test environment, coverage, and setup files.
Configuration Template
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
},
});
Example Invocations
Prompt: "Create vitest config for React with coverage"
Output: Complete vitest.config.ts with jsdom and coverage settings.