testing-anti-patterns

Review tests for mock behavior and production code pollution.

19|4|Updated Dec 23, 2021
One-click install
npx skills add https://github.com/raas-dev/configent --skill testing-anti-patterns-raas-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/raas-dev/configent/tree/main/etc/claude-code/skills/testing-anti-patterns
Command: npx skills add https://github.com/raas-dev/configent --skill testing-anti-patterns-raas-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid common mistakes in test writing that lead to unreliable tests, false positives, and polluted production code. It ensures your tests verify real behavior, not just the behavior of your mocks.

Core Features & Use Cases

  • Mock Behavior Prevention: Guides against testing mocks instead of actual code behavior, ensuring your tests provide real confidence.
  • Production Code Purity: Prevents adding test-only methods to production classes, keeping your production codebase clean and focused.
  • Dependency Understanding: Ensures you mock only when necessary and with a full understanding of the dependency chain, avoiding unintended side effects.
  • Use Case: When reviewing or writing new tests, this skill acts as a guardrail, ensuring your tests are effective, maintainable, and don't introduce hidden issues or false confidence.

Quick Start

❌ BAD: Testing mock existence

test('renders sidebar', () => { render(<Page />); expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument(); });

✅ GOOD: Test real component behavior

test('renders sidebar', () => { render(<Page />); expect(screen.getByRole('navigation')).toBeInTheDocument(); });