testing-anti-patterns

Community

Avoid common testing pitfalls, write effective tests.

Authorchriscarterux
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you avoid common mistakes that lead to brittle, ineffective, or misleading tests. It ensures your tests verify actual code behavior, not just mock interactions, preventing false confidence, wasted effort, and future regressions in your testing strategy.

Core Features & Use Cases

  • Prevent Mock Behavior Testing: Learn to assert on real component behavior rather than the existence or actions of mocks, ensuring tests are meaningful and robust.
  • Avoid Production Pollution: Keep your production codebase clean by preventing the introduction of methods or code used solely for testing purposes.
  • Strategic Mocking: Understand when and how to mock dependencies effectively, ensuring isolation without breaking the test's logic or assumptions about real-world interactions.
  • Use Case: You're writing a test for a Page component that uses a Sidebar. Instead of asserting that a sidebar-mock exists, this skill guides you to either test the real Sidebar behavior or, if mocking, to test the Page's interaction with the Sidebar's expected output, not the mock itself.

Quick Start

BAD: Testing that the mock exists

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

GOOD: Test real component or don't mock it

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

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: testing-anti-patterns
Download link: https://github.com/chriscarterux/chris-claude-stack/archive/main.zip#testing-anti-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.