Claude-code-workflows test-implement

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.

install
source · Clone the upstream repo
git clone https://github.com/shinpr/claude-code-workflows
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/shinpr/claude-code-workflows "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/test-implement" ~/.claude/skills/shinpr-claude-code-workflows-test-implement && rm -rf "$T"
manifest: skills/test-implement/SKILL.md
source content

Test Implementation Patterns

Reference Selection

Test TypeReferenceWhen to Use
Unit / Integrationreferences/frontend.mdImplementing React component tests with RTL + Vitest + MSW
E2Ereferences/e2e.mdImplementing 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