vitest-unit-testing

Installation
SKILL.md

Unit testing with Vitest

Write focused TypeScript unit tests with Vitest 5. Test observable contracts, keep each test independent, and follow the target project's established conventions.

Establish the project context

Before editing tests, inspect the target project's:

  • Vitest version and supported Node.js version
  • package scripts, test root, configuration files, and named projects
  • test environment, such as Node, happy-dom, jsdom, or Browser Mode, and the setup files loaded for each test
  • cleanup settings, especially clearMocks, mockReset, and restoreMocks
  • local naming, file placement, fixtures, helpers, and assertion style

This skill targets Vitest 5. Adapt APIs and defaults when the project uses an older version. A request to change tests does not by itself authorize a dependency upgrade.

Choose the test boundary and environment

Installs
46
First Seen
Mar 31, 2026