vitest-runner_skill

This skill runs and manages Vitest test suites with coverage, reporting, and diagnostics to speed up JS/TS test automation.
  • TypeScript

92

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill jmagly/aiwg --skill vitest-runner

  • SKILL.md4.1 KB

Overview

This skill runs and manages JavaScript/TypeScript test suites using Vitest, handling discovery, execution, coverage reporting, watch mode, and parallel runs. It focuses on safe, reproducible test automation with built-in environment checks, failure analysis, and checkpointing. Use it to run targeted tests, collect coverage, and triage failures without modifying project code or configs without permission.

How this skill works

The skill first verifies Node.js, vitest presence, and that test files exist before any run. It discovers tests, supports listing or filtering by pattern, and executes runs with options for coverage, watch mode, and parallel pools. After execution it captures results and coverage, extracts failures, saves checkpoint artifacts, and provides a recovery protocol for common error types.

When to use it

  • Run CI/test automation for JS/TS projects that use Vitest
  • Collect coverage reports or enforce coverage thresholds
  • Debug failing tests with verbose output and failure extraction
  • Run tests in watch mode during development
  • Execute a subset of tests by pattern or specific file

Best practices

  • Always run the environment check: Node version, package.json, and vitest installed before executing tests
  • Ask the user when multiple configs or unclear thresholds appear; never guess config changes
  • Prefer single-run with --coverage in CI and use --watch locally for iterative debugging
  • Capture verbose output to a file for post-run failure analysis and reproducibility
  • Limit retries to a few attempts and escalate with full context when persistent failures occur

Example use cases

  • Run full test suite with coverage: npx vitest run --coverage and save summary for CI
  • List discovered tests to validate test discovery before a large run: npx vitest list
  • Run a focused set of tests: npx vitest run --grep "authentication" or npx vitest run src/auth.test.ts
  • Use watch mode during development: npx vitest --watch to get instant feedback on changes
  • Run tests in parallel to reduce runtime: npx vitest run --pool threads --poolOptions.threads.maxThreads 4

FAQ

Verify Node.js is installed at the correct version, ensure package.json lists vitest, and confirm test files (*.test.ts, *.spec.ts) exist. Do not run tests without node_modules present.

What if tests fail with "Cannot find module" or SyntaxError?

Capture the test output, then check imports and tsconfig path mappings for missing modules. For SyntaxError, validate TypeScript compilation and transpilation settings; adjust timeouts for async-related errors.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
vitest-runner skill by jmagly/aiwg | VeilStrat