vitest

Run unit tests for JavaScript and TypeScript projects with Vite.

395|50|Updated Jul 5, 2017
One-click install
npx skills add https://github.com/alonronin/mockingoose --skill vitest-alonronin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/alonronin/mockingoose/tree/main/.agents/skills/vitest
Command: npx skills add https://github.com/alonronin/mockingoose --skill vitest-alonronin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a rapid and efficient way to write and run unit tests for your JavaScript and TypeScript projects, integrating seamlessly with the Vite build tool.

Core Features & Use Cases

  • Fast Test Execution: Leverages Vite's infrastructure for near-instantaneous test runs and updates.
  • Jest-Compatible API: Allows easy migration from Jest with familiar syntax for tests, mocks, and assertions.
  • Rich Feature Set: Supports mocking, code coverage, type testing, and advanced configuration for complex projects.
  • Use Case: When developing a new feature, use this Skill to write comprehensive unit tests that verify component logic, API interactions, and utility functions, ensuring code quality and preventing regressions.

Quick Start

Use the vitest skill to run all tests in the project.

Frequently Asked Questions about vitest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run unit tests for a Vite project using TypeScript?

Vitest provides a Jest-compatible API for JavaScript and TypeScript projects, allowing you to easily migrate your existing tests, mocks, and assertions without rewriting your testing logic.

Can I use Jest assertions and mocks when migrating to Vitest?

Vitest provides a Jest-compatible API for JavaScript and TypeScript projects, allowing you to easily migrate your existing tests, mocks, and assertions without rewriting your testing logic.

What testing environments does Vitest support for JavaScript projects?

Vitest supports various environments including Node.js, JSDOM, and Happy DOM, enabling comprehensive testing scenarios for browser-like interactions and DOM manipulation.

How do I measure code coverage and test types in a TypeScript project?

Vitest includes built-in code coverage and type testing features, allowing you to verify type correctness and measure test coverage directly within your TypeScript testing workflow.