vitest

Write, run, and debug Vitest v4 tests for TypeScript React/Next.js projects.

6|2|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/PaulRBerg/dot-agents --skill vitest-paulrberg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/PaulRBerg/dot-agents/tree/main/skills/vitest
Command: npx skills add https://github.com/PaulRBerg/dot-agents --skill vitest-paulrberg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers efficiently learn, configure, and apply Vitest v4 for TypeScript React/Next.js projects, improving test quality and maintainability.

Core Features & Use Cases

  • Comprehensive Vitest v4 guidance for TypeScript React/Next.js projects, covering setup, writing tests, and running test suites.
  • Unit and component testing patterns including mocks, timers, and coverage strategies to streamline reliable test suites.
  • Monorepo-friendly testing workflows with guidance on aliases, setup files, and cross-package test organization.

Quick Start

Install Vitest in your project and initialize a standard configuration, then run tests with nlx vitest run. Use the quick-start prompts to adapt templates for new tests or debugging sessions.

Frequently Asked Questions about vitest

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

FAQPage Schema
How do I set up Vitest v4 for a TypeScript React project?

To set up Vitest v4 for a TypeScript React project, install Vitest and initialize a standard configuration using vitest.config.ts. You then configure setup files and path aliases to establish your testing environment.

What's the best way to mock modules and timers in Vitest for Next.js apps?

The best way to mock modules and timers in Vitest for Next.js apps is by applying common mocking patterns within your component tests. This skill provides specific guidance on configuring mocks and timers to ensure reliable test execution.

Does this Vitest guidance support monorepo test organization?

Yes, this Vitest guidance supports monorepo-friendly testing workflows. It provides specific strategies for cross-package test organization, including how to configure path aliases and setup files across multiple packages.

How do I track code coverage with Vitest in a TypeScript project?

To track code coverage with Vitest in a TypeScript project, you apply the coverage strategies provided by this skill. It outlines configuration steps within vitest.config.ts to help you measure and maintain comprehensive test coverage.

Why are my unit tests failing to resolve path aliases in my Next.js monorepo?

Unit tests fail to resolve path aliases in a Next.js monorepo when vitest.config.ts lacks proper alias configuration. This skill offers troubleshooting guidance to correctly map path aliases and resolve module import issues.