unit-testing

Generate structured unit test templates for JavaScript, TypeScript, React, and Node projects.

7|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/joabgonzalez/ai-agents-skills --skill unit-testing-joabgonzalez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-testing
Source: https://github.com/joabgonzalez/ai-agents-skills/tree/main/skills/unit-testing
Command: npx skills add https://github.com/joabgonzalez/ai-agents-skills --skill unit-testing-joabgonzalez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unit testing requires structured approaches to ensure tests are readable, maintainable, and reliable across frontend and backend codebases.

Core Features & Use Cases

  • AAA Pattern (Arrange-Act-Assert) to ensure clear test structure.
  • Test Isolation to avoid cross-test contamination.
  • One Assertion per Concept + Naming to keep tests focused and readable.
  • Mock Boundaries to test unit logic without external I/O.
  • Decision Tree to guide test scope and depth.
  • Edge Case Coverage to handle common failure scenarios.
  • Organization tips like keeping helper factories in test/helpers.

Quick Start

Create a basic unit-test template for a frontend or backend module following these patterns.

Frequently Asked Questions about unit-testing

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

FAQPage Schema
How do I structure maintainable unit tests for React and Node?

Structure maintainable unit tests using the AAA (Arrange-Act-Assert) pattern to ensure clear separation of setup, execution, and verification for your React and Node modules.

What is the best way to isolate unit tests and prevent cross-test contamination?

Test isolation prevents cross-test contamination by strictly mocking external I/O boundaries. This ensures each unit test runs independently without relying on shared state or unintended side effects.

How do I write unit tests for component logic and services in TypeScript?

Write unit tests for component logic and services by applying structured test templates with jest and react-testing-library, maintaining one assertion per concept to keep tests focused and readable.

Does this unit testing approach work for both frontend and backend codebases?

Yes, this approach applies structured testing patterns like mock boundaries and decision trees to both frontend and backend codebases, ensuring consistent practices across JavaScript and TypeScript projects.

When should I use mocks versus stubs in JavaScript unit testing?

Use mocks to define and verify external I/O boundaries, keeping unit logic isolated. A decision tree helps guide the exact scope and depth of mocking required for each specific module.