Skip to content

Modern Vitest guide for TypeScript and JavaScript tests, covering unit, integration, mocking, and coverage workflows.

CCM score
52 of 100
skills.sh installs
1.3K
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers configuration, running tests, writing assertions, mocking functions, modules, and timers, plus coverage reporting
  • Includes vitest.config.ts setup with v8 coverage thresholds of 80 percent for lines, functions, and branches
  • Documents CLI usage such as bun test --run, --coverage, --grep, and --ui for CI and interactive work
  • Designed for TypeScript and JavaScript projects that want fast tests with native ESM support and Vite-powered tooling

Install

$ npx -y skills add secondsky/claude-skills --skill vitest-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Vitest Testing

Expert knowledge for testing JavaScript/TypeScript projects using Vitest - a blazingly fast testing framework powered by Vite.

Quick Start

Installation

# Using Bun (recommended)
bun add -d vitest

# Using npm
npm install -D vitest

Configuration

// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    globals: true,
    environment: 'node', // or 'jsdom'
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html'],
      thresholds: { lines: 80, functions: 80, branches: 80 },
    },
    include: ['**/*.{test,spec}.{js,ts,jsx,tsx}'],
  },
})

Running Tests

# Run all tests (prefer bun)
bun test

# Watch mode (default)
bun test --watch

# Run once (CI mode)
bun test --run

# With coverage
bun test --coverage

# Specific file
bun test src/utils/math.test.ts

# Pattern matching
bun test --grep="calculates sum"

# UI mode (interactive)
bun test --ui

# Verbose output (in Vitest 2+, --reporter=verbose prints a flat list;
# use --reporter=tree for the hierarchical tree view)
bun test --reporter=verbose

Writing Tests

Basic Structure

Details

Repository
github.com/secondsky/claude-skills
Categories
Testing & QA, Frontend & UI Code
First seen
Jun 3, 2026

Questions

What is the vitest-testing skill for?

The vitest-testing skill guides an agent through testing TypeScript and JavaScript projects with Vitest, covering fast unit and integration tests, native ESM support, and mocking. It is meant for teams that want to test TS and JS code with this framework.

How do I install the vitest-testing skill?

Run npx -y skills add secondsky/claude-skills --skill vitest-testing -y in your project. This installs the skill so your agent can use Vitest guidance for writing and running tests.

Where does vitest-testing rank in the Testing & QA category?

vitest-testing is listed in the Testing & QA category on Claude Marketplaces, alongside tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. It focuses on Vitest specifically, covering configuration, mocking, timers, coverage and integration tests with supertest.

What does the vitest-testing skill need to run?

The skill's SKILL.md recommends installing Vitest with Bun or npm, and it includes a vitest.config.ts setup with options such as globals and environment set to node or jsdom. Its examples run tests through bun test, so the project needs a working Bun or npm setup.

More from secondsky/claude-skills

All 116

Similar to Vitest Testing

More Testing & QA