Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
onmax avatar

Vitest

  • 2.5k installs
  • 696 repo stars
  • Updated July 27, 2026
  • onmax/nuxt-skills

vitest is a Nuxt skills entry for writing Vitest tests in Vite projects with mocks, coverage, and config guidance.

About

The vitest skill covers the Vite-native Vitest framework with a Jest-compatible API for unit and integration tests in Vite, Vue, React, and Svelte projects. Quick start installs vitest as a dev dependency and defines vitest.config.ts with globals and node or jsdom environments. Tests use describe, it, expect, and vi imports for mocks. Reference files split configuration and CLI, test API and hooks, vi.fn and vi.mock mocking, expect snapshots and coverage utilities, and advanced environments plus browser mode guidance. The skill instructs agents to load only relevant reference files per task rather than reading all docs at once. Cross-skill pointers defer Vue component testing to the vue skill, library patterns to ts-library, and shared Vite settings to the vite skill. Use cases include mocking modules and timers, running concurrent tests, and TypeScript type testing. License is MIT and installation assumes an existing Vite-based project toolchain.

  • Vitest is Vite-native with Jest-compatible describe, it, and expect APIs.
  • Configure environment node or jsdom in vitest.config.ts.
  • Reference files cover config, mocking, utilities, and advanced modes.
  • Load only relevant reference markdown per task, not all at once.
  • Cross-links to vue, ts-library, and vite skills for related patterns.

Vitest by the numbers

  • 2,502 all-time installs (skills.sh)
  • +60 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #342 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

vitest capabilities & compatibility

Capabilities
vitest.config.ts bootstrap with environments · describe/it test structure and hooks references · vi.fn, vi.mock, and timer mocking patterns · coverage, snapshots, and filtering utilities · progressive reference loading guidance
Use cases
testing · frontend
From the docs

What vitest says it does

Vite-native testing framework with Jest-compatible API.
SKILL.md
DO NOT load all files at once.
SKILL.md
npx skills add https://github.com/onmax/nuxt-skills --skill vitest

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.5k
repo stars696
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositoryonmax/nuxt-skills

How do I set up Vitest and write tests with mocks and coverage in a Vite project?

Write Vitest unit and integration tests for Vite projects with config, mocks, coverage, and parallel execution.

Who is it for?

Vite, Vue, React, or Svelte projects adopting Vitest for unit and integration tests.

Skip if: Skip for Jest-only Create React App projects not using Vite without migration.

When should I use this skill?

User asks about vitest.config.ts, vi.mock, describe/it tests, or Vite test coverage.

What you get

Working vitest.config.ts, test files, and targeted reference guidance for mocks or coverage needs.

  • vitest.config.ts
  • Multi-project test setup
  • Per-file environment directives

By the numbers

  • Documents four Vitest test environments: node, jsdom, happy-dom, edge-runtime
  • Includes install commands for two DOM packages: jsdom and happy-dom

Files

SKILL.mdMarkdownGitHub ↗

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:

  • [ ] references/config.md - if setting up vitest.config.ts, CLI, or workspace projects
  • [ ] references/test-api.md - if writing test/describe blocks, using hooks, or test fixtures
  • [ ] references/mocking.md - if mocking modules, timers, dates, or using spies
  • [ ] references/utilities.md - if writing assertions, snapshots, or configuring coverage
  • [ ] 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

Related skills

How it compares

Pick vitest for Nuxt-aligned Vitest environment and multi-project setup; use Jest migration guides when the codebase is still locked to Jest APIs and plugins.

FAQ

Which environment should DOM tests use?

Set test.environment to jsdom in vitest.config.ts for DOM APIs; use node for pure logic.

Should I read every reference file?

No. Load only the reference matching your task such as mocking.md or config.md.

Where do Vue component test patterns live?

Use the vue skill for component testing; vitest covers the test runner setup and APIs.

Is Vitest safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Testing & QAtestingfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.