This skill is organized to match the Vitest official documentation structure (https://vitest.dev/guide/, https://vitest.dev/api/, https://vitest.dev/config/). When working with Vitest:
- Identify the topic from the user's request:
- Getting started/ๅฟซ้ๅผๅง โ examples/getting-started.md
- Features/ๅ่ฝ็นๆง โ examples/features.md
- Component testing/็ปไปถๆต่ฏ โ examples/component-testing.md
- Browser mode/ๆต่งๅจๆจกๅผ โ examples/browser-mode.md
- API/API ๆๆกฃ โ api/
- Configuration/้
็ฝฎ โ examples/config/
- Load the appropriate example file from the
examples/ directory:
Getting Started (ๅฟซ้ๅผๅง):
- examples/getting-started.md - Installation and first test
Features (ๅ่ฝ็นๆง):
- examples/features.md - Key features and capabilities
- examples/ui.md - Vitest UI
- examples/component-testing.md - Component testing
- examples/browser-mode.md - Browser mode testing
- examples/visual-regression-testing.md - Visual regression testing
- examples/trace-view.md - Trace view
Testing (ๆต่ฏ):
- examples/test-api.md - Test API (test, it, describe, etc.)
- examples/mocking.md - Mocking functions and modules
- examples/snapshots.md - Snapshot testing
- examples/coverage.md - Code coverage
Configuration (้
็ฝฎ):
- examples/config/basic-config.md - Basic configuration
- examples/config/environment.md - Environment configuration
- examples/config/browser-config.md - Browser mode configuration
- Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Vitest is designed for Vite projects
- Supports TypeScript, JSX, ESM out of the box
- Fast watch mode with HMR-like experience
- Compatible with Jest API
- Examples include both JavaScript and TypeScript versions
- Each example file includes key concepts, code examples, and key points
- Reference API documentation in the
api/ directory when needed:
- api/test-api.md - Test API reference
- api/vi-utility.md - vi utility functions
- api/expect.md - Expect assertions
- api/mocking.md - Mocking API
- Use templates from the
templates/ directory:
- templates/vitest-config.md - Vitest configuration templates
- templates/test-examples.md - Test example templates
Doc mapping (one-to-one with https://vitest.dev/guide/, https://vitest.dev/api/, https://vitest.dev/config/)
Guide (ๆๅ):
examples/getting-started.md โ https://vitest.dev/guide/getting-started.htmlexamples/features.md โ https://vitest.dev/guide/features.htmlexamples/ui.md โ https://vitest.dev/guide/ui.htmlexamples/component-testing.md โ https://vitest.dev/guide/testing-components.htmlexamples/browser-mode.md โ https://vitest.dev/guide/browser.htmlexamples/visual-regression-testing.md โ https://vitest.dev/guide/visual-regression.htmlexamples/trace-view.md โ https://vitest.dev/guide/trace-view.htmlexamples/mocking.md โ https://vitest.dev/guide/mocking.htmlexamples/snapshots.md โ https://vitest.dev/guide/snapshot.htmlexamples/coverage.md โ https://vitest.dev/guide/coverage.html
Configuration (้
็ฝฎ):
examples/config/basic-config.md โ https://vitest.dev/config/examples/config/environment.md โ https://vitest.dev/config/#environmentexamples/config/browser-config.md โ https://vitest.dev/config/#browser
API Reference:
api/test-api.md โ https://vitest.dev/api/api/vi-utility.md โ https://vitest.dev/api/vi.htmlapi/expect.md โ https://vitest.dev/api/expect.htmlapi/mocking.md โ https://vitest.dev/api/vi.html