frontend-unit-test

Detect Jest or Vitest and run targeted frontend unit tests.

2|Updated Jun 1, 2017
One-click install
npx skills add https://github.com/carlos-algms/dotfiles --skill frontend-unit-test-carlos-algms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-unit-test
Source: https://github.com/carlos-algms/dotfiles/tree/main/AI-configs/skills/frontend-unit-test
Command: npx skills add https://github.com/carlos-algms/dotfiles --skill frontend-unit-test-carlos-algms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents wasted time caused by running the wrong test runner (Jest vs Vitest) and helps you consistently execute the correct unit tests in JavaScript/TypeScript frontend projects.

Core Features & Use Cases

  • Framework detection before running: identifies the test framework by inspecting imports, config files (vitest.config.* / jest.config.*), package.json dependencies, and test scripts.
  • Targeted test execution: runs only the most relevant tests (for a single file or test path) instead of running the entire suite.
  • Monorepo-aware workflow: supports running tests inside the nearest package.json (e.g., under apps/) for workspace setups.

Use Case: When debugging a failing component in a monorepo, you can run the exact file’s tests from the closest package directory without guessing whether the project uses Jest or Vitest.

Quick Start

Run pnpm run test for your specific test file path after confirming the closest package.json in your monorepo.

Frequently Asked Questions about frontend-unit-test

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

FAQPage Schema
How do I run unit tests in a monorepo without guessing the test runner?

Running unit tests in a monorepo requires detecting the framework via imports, config files, and package.json dependencies, then executing the targeted test scope from the nearest package directory.

How does framework detection work for Jest and Vitest projects?

Framework detection for Jest and Vitest works by inspecting project imports, checking for vitest.config or jest.config files, analyzing package.json dependencies, and evaluating configured test scripts.

Can I run a single frontend test file instead of the full suite?

Yes, you can run a single frontend test file. The tool executes targeted tests for a specific file or test path, providing reliable feedback without running the entire suite.

Does this approach work with both JavaScript and TypeScript frontend projects?

Yes, this approach works with both JavaScript and TypeScript frontend projects. It selects the correct test runner and executes the appropriate test scope for reliable JS/TS feedback.

What's the best way to run Vitest tests inside a specific workspace package?

The best way to run Vitest tests inside a specific workspace package is by locating the closest package.json, such as under apps/, and running the test command from that directory.