vitest

Vite-native unit and integration testing framework with Jest-compatible API and parallel execution. Supports testing Vue, React, and Svelte components with configurable environments (Node, jsdom, or browser mode) Provides Jest-compatible API including describe/it blocks, hooks, fixtures, and globals configuration Includes comprehensive mocking capabilities: vi.fn for function mocks, vi.mock for module mocking, and timer/date utilities Offers code coverage thresholds, snapshot testing, and type testing support with TypeScript Runs tests concurrently by default with workspace project support and CLI filtering options

INSTALLATION
npx skills add https://github.com/onmax/nuxt-skills --skill vitest
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

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.ts

import { defineConfig } from 'vitest/config'

export default defineConfig({

  test: {

    globals: true,

    environment: 'node',  // or 'jsdom' for DOM tests

  },

})
// example.test.ts

import { describe, expect, it, vi } from 'vitest'

describe('math', () => {

  it('adds numbers', () => {

    expect(1 + 1).toBe(2)

  })

})

Reference Files

Task

File

Configuration, CLI, projects

config.md

test/describe, hooks, fixtures

test-api.md

vi.fn, vi.mock, timers, spies

mocking.md

expect, snapshots, coverage, filtering

utilities.md

Environments, type testing, browser mode

advanced.md

Loading Files

Consider loading these reference files based on your task:

DO NOT load all files at once. Load only what's relevant to your current task.

Cross-Skill References

  • Vue component testing → Use vue skill for component patterns
  • Library testing → Use ts-library skill for library patterns
  • Vite configuration → Use vite skill for shared config
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card