unit-tests

Installation
SKILL.md

Unit Tests

Unit tests use Vitest and live next to the source they test: src/module.spec.ts beside src/module.ts (.spec.tsx for component tests, .spec.js in JS packages). No __tests__ directories.

Imports and primitives

Import test primitives by name from vitest:

import {
  vi,
  describe,
  it,
  expect
} from 'vitest'

Always use it, never test. Import vi only when the file actually mocks or fakes something.

Installs
25
First Seen
Jul 10, 2026