Agent Skills: Test Implementation Patterns

Test implementation patterns and conventions. Use when implementing unit tests, integration tests, or E2E tests, including RTL+Vitest+MSW component testing and Playwright E2E testing.

UncategorizedID: shinpr/claude-code-workflows/test-implement

Install this agent skill to your local

pnpm dlx add-skill https://github.com/shinpr/claude-code-workflows/tree/HEAD/skills/test-implement

Skill Files

Browse the full folder contents for test-implement.

Download Skill

Loading file tree…

skills/test-implement/SKILL.md

Skill Metadata

Name
test-implement
Description
Test implementation patterns and conventions. Use when implementing unit tests, integration tests, or E2E tests, including RTL+Vitest+MSW component testing and Playwright E2E testing.

Test Implementation Patterns

Reference Selection

| Test Type | Reference | When to Use | |-----------|-----------|-------------| | Unit / Integration | references/frontend.md | Implementing React component tests with RTL + Vitest + MSW | | E2E | references/e2e.md | Implementing browser-level E2E tests with Playwright |

Common Principles

AAA Structure

All tests follow Arrange-Act-Assert:

  • Arrange: Set up preconditions and inputs
  • Act: Execute the behavior under test
  • Assert: Verify the expected outcome

Test Independence

  • Each test runs independently without depending on other tests
  • No shared mutable state between tests
  • Deterministic execution — no random or time dependencies without mocking

Naming

  • Test names describe expected behavior from user perspective
  • One test verifies one behavior