Skip to content
vitest logo

Vitest

vitest

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

onmax/nuxt-skills3Kinstalls717starsTesting & QA

SKILL.md

Full skill instructions

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

TaskFile
Configuration, CLI, projectsconfig.md
test/​describe, hooks, fixturestest-api.md
vi.fn, vi.mock, timers, spiesmocking.md
expect, snapshots, coverage, filteringutilities.md
Environments, type testing, browser modeadvanced.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

More Testing & QA skills

Write tests first, watch them fail, then implement minimal code to pass.

295.4K 244.7K
View

Enforce verification commands before claiming work completion, fixes, or test passes—no success assertions without fresh evidence.

295.4K 230.2K
View

Dispatch fresh subagents per task with two-stage review (spec compliance, then code quality) in the current session.

295.4K 221.7K
View

Evaluate code review feedback with technical rigor before implementing, avoiding performative agreement and blind implementation.

295.4K 208.8K
View
writing-skills logo
Testing & QA

writing-skills

Test-driven documentation for creating reusable agent techniques, patterns, and reference guides.

295.4K 205.7K
View

Structured workflow for completing development branches with test verification and merge/PR options.

295.4K 202.3K
View
playwright-cli logo
Testing & QA

playwright-cli

Browser automation with 40+ commands for navigation, interaction, form filling, and web testing.

13.8K 175.3K
View
webapp-testing logo
Testing & QA

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View

Comprehensive reference guide for writing, debugging, and maintaining Playwright tests across all testing types and scenarios.

388 90.1K
View
solana-dev logo
Testing & QA

solana-dev

End-to-end Solana development with framework-kit, @solana/kit, Anchor programs, and local testing.

567 81.7K
View
expo-dev-client logo
Testing & QA

expo-dev-client

Build custom Expo development clients for testing native code on physical devices via EAS Build or locally.

2.7K 64.8K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View