testing

Guide TypeScript/JavaScript developers through RED-GREEN-REFACTOR test-driven development cycles.

Updated Dec 25, 2025
One-click install
npx skills add https://github.com/Mavrick91/tanstack-start-app --skill testing-mavrick91
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Mavrick91/tanstack-start-app/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/Mavrick91/tanstack-start-app --skill testing-mavrick91

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Testing Skill provides a structured approach to working with test files (.test.ts, .test.tsx), promoting consistent test-first development and efficient debugging.

Core Features & Use Cases

  • Enforces a strict TDD workflow (RED → GREEN → REFACTOR) to improve code quality.
  • Guides on test scaffolding, mocking, and using common testing utilities (e.g., renderComponent helper pattern, waitFor, user-event).
  • Applicable to creating, reviewing, and maintaining tests across feature development, bug fixes, and refactoring tasks.

Quick Start

Begin the TDD workflow by writing a failing test, then implement to pass, and finally refactor as needed.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I structure a test-driven development workflow for TypeScript?

Test-driven development in TypeScript follows a strict RED → GREEN → REFACTOR cycle. You begin by writing a failing test, implement the minimum code required to pass it, and then refactor while maintaining test coverage.

What is the best way to mock dependencies in Vitest test files?

Mocking dependencies in Vitest involves using structured patterns like the renderComponent helper and waitFor. These utilities guide test scaffolding and ensure asynchronous operations settle before assertions run.

How do I debug failing tests in a TypeScript JavaScript project?

Debugging failing TypeScript tests involves applying structured TDD workflows to isolate failures. You review test scaffolding, verify mock implementations, and use testing utilities to trace execution paths back to the source code.

Can I use this TDD workflow for both feature development and bug fixes?

Yes, the TDD workflow applies to creating, reviewing, and maintaining tests across feature development, bug fixes, and refactoring tasks. It enforces test-first development practices to improve code quality consistently.

When should I use waitFor in my test files?

You use waitFor in test files when dealing with asynchronous operations that require the UI or state to settle before assertions. It is part of the structured testing utilities prescribed for reliable test execution.