SuperAPI AI Directory

vitest

Testing & quality

View repository

Updated 10-15 21:40

About this skill

Vitest API Reference

Vitest — Vite-native testing framework. Referenced when writing, reviewing, or refactoring tests.

Directory structure

skills/vitest/
  SKILL.md
  references/
    api/
      README.md
      test-api.md
      expect.md
      vi.md
    guide/
      README.md
      cli.md
      config.md
      coverage.md
      environment.md
      snapshot.md
      testing-types.md
      workspace.md
    patterns/
      README.md
      mocking.md
      async.md
  samples/
    README.md
    basic-test.md
    coverage-setup.md
    describe-and-hooks.md
    mocking-modules.md
    parameterized-tests.md
    snapshot-testing.md
    spy-on-methods.md
    test-environment.md
    type-testing.md
    workspace-setup.md
  scripts/
    README.md
    cli.md
    coverage.md
    install.md
    setup.md

Exploration procedure

Derive the category from the task, and identify the target page in the category's README.md:

  1. Find the category corresponding to the task in the mapping table below
  2. of that category references/{category}/README.md Refer to this to identify the target page
  3. Read the .md of the relevant page to check the details

Task → Category Mapping

Task Category Reference README
Want to use describe, it/test, hooks, modifiers, each/for api references/api/README.md
Want to look up expect matchers (equality, types, numbers, collections, snapshots, async) api references/api/README.md
Want to use vi.fn, vi.mock, vi.spyOn, timers, stubs api references/api/README.md
Want to look up configuration options for vitest.config.ts guide references/guide/README.md
Want to look up CLI commands and flags (reference) guide references/guide/README.md
Want to configure coverage (v8 / istanbul) guide references/guide/README.md
Want to switch the test environment (jsdom, happy-dom, edge-runtime) guide references/guide/README.md
Want to configure snapshot testing, type testing, and workspaces guide references/guide/README.md
Want to know mock patterns (vi.fn, vi.mock, vi.spyOn, partial mocks) patterns references/patterns/README.md
Want to know patterns for async testing and fake timers patterns references/patterns/README.md
Want to refer to typical usage and examples samples samples/README.md
Want to know installation, CLI commands, and setup procedures scripts scripts/README.md