Use when writing unit/integration tests for Vite projects - configure vitest.config.ts, write test suites with describe/it, create mock implementations with vi.fn and vi.mock, set up code coverage thresholds, and run tests in parallel
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Use when writing unit/integration tests for Vite projects - configure vitest.config.ts, write test suites with describe/it, create mock implementations with vi.fn and vi.mock, set up code coverage thresholds, and run tests in parallel
license
MIT
Vitest
Vite-native testing framework with Jest-compatible API.
When to Use
Writing unit/integration tests for Vite projects
Testing Vue/React/Svelte components
Mocking modules, timers, or dates
Running concurrent/parallel tests
Type testing with TypeScript
Quick Start
npm i -D vitest
// vitest.config.tsimport { defineConfig } from'vitest/config';
exportdefaultdefineConfig({
test: {
globals: true,
environment: 'node', // or 'jsdom' for DOM tests
},
});