writing-tests

Installation
SKILL.md

If the current repo has its own rules/skills covering this topic (check .claude/rules/ and repo CLAUDE.md), those take precedence — apply this skill only where they're silent.

Writing Tests

Core principle: Test user-observable behavior with real dependencies. Tests should survive refactoring.

"The more your tests resemble the way your software is used, the more confidence they can give you." — Kent C. Dodds

Why this matters: Tests exist to give you confidence. The Testing Trophy prioritizes integration tests because they test real behavior across real modules — giving maximum confidence per test written. Unit tests in isolation often just test mocks, not your actual system.

Testing Trophy Model

Priority Type When
1st Integration Default - multiple units with real dependencies
2nd E2E Complete user workflows
3rd Unit Pure functions only (no dependencies)

Mocking Guidelines

Installs
19
GitHub Stars
127
First Seen
Feb 12, 2026
writing-tests — rileyhilliard/claude-essentials