test-vitest
Installation
SKILL.md
Use this skill when working with Vitest unit tests. The semantics below are Vitest 2 and later — mock resetting and restoration behave differently on 1.x.
Requires
- test-unit-guidelines
Vitest Rules
Test Structure
Use describe to name the unit and it to name the behaviour. Import the globals explicitly rather than relying on globals: true, so a test file's dependencies are visible.
import { describe, it, expect } from "vitest";
import { applyDiscount } from "./pricing";