testing-patterns

Provide testing patterns for ActionPhase across unit, API, component, and Playwright E2E tests.

1|Updated Nov 7, 2017
One-click install
npx skills add https://github.com/jhouser/actionphase --skill testing-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/jhouser/actionphase/tree/main/.claude/skills/testing-patterns
Command: npx skills add https://github.com/jhouser/actionphase --skill testing-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, react testing library, github.com/stretchr/testify, and includes references (resource) components.

What problem does it solve?

Inconsistent or insufficient testing leads to bugs, regressions, and unreliable software. This skill provides a comprehensive guide to ActionPhase's testing strategy, ensuring developers write effective tests across all layers (unit, component, API, E2E), follow TDD principles, and maintain high code quality.

Core Features & Use Cases

  • Testing Pyramid: Explains the hierarchy of tests (unit, API, component, E2E) and their roles.
  • TDD Workflow: Guides through the Test-Driven Development process for new features and mandatory regression testing for bug fixes.
  • Multi-Language Testing: Covers patterns for Go backend tests, React Testing Library for frontend components, and Playwright for E2E scenarios.
  • Use Case: When starting a new feature, use this skill to follow the TDD workflow: write a failing unit test, implement the feature, verify with API and component tests, and only then create an an E2E test, ensuring comprehensive coverage and early bug detection.

Quick Start

Ask for the command to run all backend unit tests without a database.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I structure tests across unit, component, API, and end-to-end layers?

The Testing Pyramid organizes tests by scope: many unit tests at the base for fast feedback, fewer API and component tests in the middle, and minimal E2E tests at the top. This hierarchy balances coverage, speed, and reliability across Go backends, React frontends, and Playwright scenarios.

What's the best way to start implementing test-driven development for a new feature?

Write a failing unit test first, then implement the feature to pass it. Verify with API and component tests, then create an E2E test with Playwright. This TDD workflow ensures comprehensive coverage and catches bugs early across all layers.

How do I test React components with React Testing Library?

React Testing Library provides patterns for testing component behavior and user interactions rather than implementation details. Use it alongside unit tests to verify frontend logic, then validate end-to-end flows with Playwright.

Can I use Playwright for end-to-end testing across different browsers and platforms?

Playwright supports cross-browser E2E testing and includes patterns for fixture management and the E2E readiness checklist. Use it after component and API tests pass to validate full user workflows.

What testing patterns work for Go backend services without a database?

Go testing with testify provides unit test patterns that isolate backend logic. Run backend unit tests without a database for fast feedback, then layer in API tests that hit real or mocked dependencies.

How do I handle regression testing when fixing bugs?

Regression testing is mandatory for bug fixes: write a failing test that reproduces the bug, fix the code to pass it, then verify the fix with API and E2E tests to prevent reoccurrence.