Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Testing Patterns

Unit, integration, and E2E testing patterns with framework-specific guidance. Write tests that catch bugs, not tests that pass — confidence through coverage, speed through isolation.

What's Inside

  • Testing pyramid with ratio, speed, and confidence breakdown
  • Unit testing patterns (Arrange-Act-Assert, Given-When-Then, parameterized, snapshot, property-based)
  • Test doubles guide (stubs, mocks, spies, fakes) with when-to-use guidance
  • Parameterized tests across TypeScript, Python, and Go
  • Integration testing patterns (transaction rollback, fixtures, factory functions, testcontainers)
  • API testing with Supertest
  • Mocking best practices (mock boundaries not implementations, dependency injection)
  • Framework quick reference (Jest, Vitest, Playwright, Cypress, pytest, Go testing, Rust, JUnit, RSpec, PHPUnit, xUnit)
  • Test quality checklist (deterministic, isolated, fast, readable, maintainable, focused)
  • Coverage strategy with targets by project type
  • Test organization conventions
  • Anti-patterns catalog

When to Use

  • Writing tests for new or existing code
  • Adding test coverage to a project
  • Defining a testing strategy
  • Fixing flaky tests or improving test quality
  • Choosing the right test doubles and patterns

Installation

npx add https://github.com/wpank/ai/tree/main/skills/testing/testing-patterns

OpenClaw / Moltbot / Clawbot

npx clawhub@latest install testing-patterns

Manual Installation

Cursor (per-project)

From your project root:

mkdir -p .cursor/skills
cp -r ~/.ai-skills/skills/testing/testing-patterns .cursor/skills/testing-patterns

Cursor (global)

mkdir -p ~/.cursor/skills
cp -r ~/.ai-skills/skills/testing/testing-patterns ~/.cursor/skills/testing-patterns

Claude Code (per-project)

From your project root:

mkdir -p .claude/skills
cp -r ~/.ai-skills/skills/testing/testing-patterns .claude/skills/testing-patterns

Claude Code (global)

mkdir -p ~/.claude/skills
cp -r ~/.ai-skills/skills/testing/testing-patterns ~/.claude/skills/testing-patterns

Related Skills


Part of the Testing skill category.