writing-tests

Generate React and TypeScript unit tests using AAA structure and TDD principles.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mgr-kb/mgr-dotfiles --skill writing-tests-mgr-kb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/mgr-kb/mgr-dotfiles/tree/main/claude/skills/writing-tests
Command: npx skills add https://github.com/mgr-kb/mgr-dotfiles --skill writing-tests-mgr-kb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers write high-quality tests by following Test-Driven Development principles, reducing debugging time and improving code confidence.

Core Features & Use Cases

  • Co-located tests: place tests next to implementation to simplify navigation and maintenance.
  • Clear naming conventions: descriptive test names that communicate intent and coverage.
  • AAA-style structure: organize tests with Arrange-Act-Assert for readability and reliability.
  • Language/framework focus: applies to React + TypeScript projects, with guidance for unit, integration, and E2E scopes.

Quick Start

Ask the AI to generate unit tests for a given React component using TypeScript. Example: "Create unit tests for Button.tsx with AAA structure."

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I write unit tests for React components using TypeScript?

To write unit tests for React components in TypeScript, use AAA-style structure (Arrange-Act-Assert) and place test files next to the implementation. This co-location approach simplifies navigation and ensures descriptive test names communicate clear intent.

What is the best way to structure React TypeScript tests for maintainability?

The best way to structure React TypeScript tests is using the AAA pattern (Arrange-Act-Assert) for readability and co-locating test files next to component files. This setup reduces debugging time and improves code confidence by keeping tests and implementation together.

Does Test-Driven Development work with React and TypeScript projects?

Test-Driven Development works effectively with React and TypeScript projects by guiding co-located test files, descriptive naming conventions, and AAA-style structure. It supports unit, integration, and E2E scopes to improve overall code confidence and reliability.

Can I use co-located tests for integration and E2E testing in TypeScript?

Yes, you can use co-located tests for integration and E2E testing in TypeScript. The approach guides you in applying appropriate test types—unit, integration, or E2E—based on the scenario while maintaining clear naming conventions and AAA structure.

Why should I use AAA structure for TypeScript unit tests?

You should use AAA structure for TypeScript unit tests because it organizes tests into Arrange, Act, and Assert sections, enhancing readability and reliability. This structure reduces debugging time and ensures tests clearly communicate their intent and coverage.

When should I not use co-located tests in a React TypeScript project?

You should avoid co-located tests in React TypeScript projects when test scopes extend beyond unit testing to complex integration or E2E scenarios that require centralized test directories, although the approach generally supports all test types with proper naming conventions.