running-vitest-safely

Run Vitest test suites with --run, timeouts, and preflight checks.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/adbutterfield/coding-agent-plugins --skill running-vitest-safely
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: running-vitest-safely
Source: https://github.com/adbutterfield/coding-agent-plugins/tree/main/plugins/coding-skills/skills/running-vitest-safely
Command: npx skills add https://github.com/adbutterfield/coding-agent-plugins --skill running-vitest-safely

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents Vitest test runs from hanging and consuming resources in automated environments by enforcing safe execution.

Core Features & Use Cases

  • Pre-flight checks to detect running Vitest processes and prevent duplicates.
  • Enforced safety flags (--run, per-test timeouts, hook timeouts) to ensure timely completion.
  • Guidance for post-run cleanup and process isolation in CI and local automation.

Quick Start

Run Vitest safely in automated workflows by applying the required safety flags.

Frequently Asked Questions about running-vitest-safely

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

FAQPage Schema
Why does Vitest hang in CI and how do I prevent it?

Vitest hangs in CI when watch mode activates or tests lack timeouts. Prevent hanging Vitest processes by enforcing the --run flag, per-test timeouts, and hook timeouts for automated environments.

How do I run Vitest tests safely in automated environments?

Run Vitest safely in automated environments by applying the --run flag to disable watch mode, setting per-test timeouts, and executing preflight checks to detect running processes and prevent duplicates.

Can I use pnpm test to execute Vitest safely in local automation?

Yes, you can use pnpm test to execute Vitest safely in local automation. This applies to unit test suites invoked via pnpm test, npm test, or vitest commands, enforcing safe execution with timeouts and optional bail.

What is the best way to stop duplicate Vitest processes during test runs?

The best way to stop duplicate Vitest processes is to run preflight checks that detect running Vitest processes before starting a new test run. This prevents duplicates and ensures safe process isolation.

What are the limitations of running Vitest without timeouts in Node?

Running Vitest without timeouts in Node allows hanging processes to consume resources indefinitely. Without enforced per-test timeouts and hook timeouts, automated test runs may fail to complete or block pipelines.