All skills
onmax avatar

/vitest

@6a37106

Use when writing unit/integration tests for Vite projects - provides Vitest configuration, test APIs, mocking patterns, and coverage setup

  • 6 files
  • 24.3 KB
  • MIT
  • Updated 8 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/onmax/claude-config/vitest

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ37 tokens always: the name and description. โ‰ˆ573 when used: this file. โ‰ˆ5.6k more on demand in 5 files.

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

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 6a37106. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 7 hours ago.

Activeupdated 8 months ago

README badge

README badge for onmax/claude-config/vitest