ts-testing

Design and maintain TypeScript test suites with Jest, Vitest, Playwright, or Cypress.

24|6|Updated Dec 19, 2025
One-click install
npx skills add https://github.com/johnlindquist/claude --skill ts-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-testing
Source: https://github.com/johnlindquist/claude/tree/main/skills/ts-testing
Command: npx skills add https://github.com/johnlindquist/claude --skill ts-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design, implement, and maintain high‑value TypeScript test suites using popular JS/TS testing libraries. Use this skill whenever adding tests, debugging failing tests, or refactoring code that should be covered by tests.

Core Features & Use Cases

  • Align with existing test tooling (Jest, Vitest, Playwright, Cypress)
  • Behavior-focused tests, fast feedback
  • Regression and mutation testing guidance

Quick Start

Generate a failing unit test scaffold for a function, then implement the minimal code to pass.

Frequently Asked Questions about ts-testing

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

FAQPage Schema
How do I write effective unit tests for TypeScript functions?

Unit tests for TypeScript validate individual functions with focused test cases. Use Jest or Vitest with TS-friendly syntax, write behavior-focused tests that verify outputs for given inputs, keep tests fast by avoiding unnecessary mocks, and ensure each test checks one thing so failures are clear and quick to diagnose.

Can I use Jest and Vitest together in the same TypeScript project?

Jest and Vitest are separate test frameworks with different configurations and runners. Choose one framework aligned with your project's existing setup rather than mixing both, as they have distinct module resolution and execution models that can conflict.

What's the best way to set up mutation testing for TypeScript code?

Mutation testing validates test quality by introducing code changes and verifying tests catch them. Run mutation tests alongside Jest or Vitest to measure test effectiveness, identify gaps in coverage where mutations survive, and refactor tests to catch more edge cases and regressions.

How do I debug a failing TypeScript test in Jest or Vitest?

Debugging failing tests means isolating the test failure, reviewing assertion output, and checking if the implementation matches expected behavior. Use clear failure diagnostics from your test framework, add focused test cases for the specific failure, and refactor code only after confirming the test intention is correct.

Should I write unit, integration, or end-to-end tests for my TypeScript codebase?

TypeScript test suites apply unit tests for isolated functions, integration tests for module interactions, and end-to-end tests for full workflows. Align test types with your repository's existing tooling and typical scenarios—unit tests provide fast feedback, integration tests verify component cooperation, and end-to-end tests catch real-world issues.

Do I need to refactor existing TypeScript code before adding test coverage?

Refactor TypeScript code for testability when functions are tightly coupled or hard to isolate, but write tests first to prevent regressions during refactoring. Use failing tests to drive incremental improvements, then implement minimal code changes to pass tests safely.