onmax/nuxt-skills

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

All-time #4775 Trending #6969 Hot #5727 First seen Jan 28, 2026
8-week activity · all time api

Installation

$ npx skills add onmax/nuxt-skills --skill vitest

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from onmax/nuxt-skills · top by installs.

npx skills add onmax/nuxt-skills

Browse all from onmax/nuxt-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 708
License MIT
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,575 B
  • docs SUMMARY.md 248 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2,742 installs

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](references/config.md)
test/describe, hooks, fixtures [test-api.md](references/test-api.md)
vi.fn, vi.mock, timers, spies [mocking.md](references/mocking.md)
expect, snapshots, coverage, filtering [utilities.md](references/utilities.md)
Environments, type testing, browser mode [advanced.md](references/advanced.md)

Loading Files

Consider loading these reference files based on your task:

  • [references/config.md](references/config.md) - if setting up vitest.config.ts, CLI, or workspace projects
  • [references/test-api.md](references/test-api.md) - if writing test/describe blocks, using hooks, or test fixtures
  • [references/mocking.md](references/mocking.md) - if mocking modules, timers, dates, or using spies
  • [references/utilities.md](references/utilities.md) - if writing assertions, snapshots, or configuring coverage
  • [references/advanced.md](references/advanced.md) - if configuring test environments, type testing, or browser mode

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