js-testing

Create and repair Vitest or Jest test suites for JavaScript and TypeScript.

7|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/chenziyang110/spec-kit-plus --skill js-testing-chenziyang110
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: js-testing
Source: https://github.com/chenziyang110/spec-kit-plus/tree/main/templates/passive-skills/js-testing
Command: npx skills add https://github.com/chenziyang110/spec-kit-plus --skill js-testing-chenziyang110

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you confidently write, fix, and improve JavaScript/TypeScript test suites by turning unclear test requests or failing behaviors into structured, framework-appropriate Vitest/Jest tests.

Core Features & Use Cases

  • New JS/TS test generation: Create unit, integration, component, or snapshot-style tests tailored to the detected framework and existing project conventions.
  • Test failure diagnosis & repair: Analyze the failure context and propose minimal, targeted changes that make tests deterministic and maintainable.
  • Coverage and regression protection: Add edge-case coverage, async/error-path cases, and optional HTTP mocking via MSW.

Quick Start

Tell your agent: "Add Vitest tests for the login flow in src/auth/login.ts and diagnose why the current test fails."

Frequently Asked Questions about js-testing

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

FAQPage Schema
How do I generate Vitest tests for my TypeScript project?

You can generate Vitest tests by requesting unit, component, or integration tests for specific files. The tool detects your framework and creates structured test suites tailored to your project conventions, including async behavior and snapshots.

Why does my Jest test fail intermittently and how can I fix it?

Intermittent Jest test failures are diagnosed by analyzing the failure context to propose minimal, targeted changes. The tool repairs tests by focusing on boundary conditions and ensuring deterministic behavior to eliminate flaky results.

What is the best way to mock HTTP API calls in unit testing?

The best way to mock HTTP API calls in unit testing is using MSW. The tool integrates MSW-based HTTP mocking to isolate API boundaries, ensuring your tests remain deterministic and do not rely on live network requests.

Does this approach work for both Vitest and Jest frameworks?

Yes, this approach works for both Vitest and Jest frameworks. The tool explicitly detects your configured testing framework and generates or repairs test suites using the appropriate syntax and conventions for either environment.

How do I improve test coverage for async and error paths?

To improve test coverage for async and error paths, the tool adds edge-case coverage and error-path cases to your suite. It targets untested boundaries and applies a verification checklist to ensure safe and comprehensive regression protection.

Can I use this for Playwright-style E2E testing?

Yes, you can use this for Playwright-style E2E testing needs. The tool handles end-to-end test generation alongside unit, component, and integration tasks, applying boundary-focused test design to ensure comprehensive coverage.