testing-anti-patterns

Enforce real component behavior in JavaScript/TypeScript unit tests.

Updated Sep 19, 2025
One-click install
npx skills add https://github.com/michael-h-patrianna/animations --skill testing-anti-patterns-michael-h-patrianna
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/michael-h-patrianna/animations/tree/main/.claude/skills/testing-anti-patterns
Command: npx skills add https://github.com/michael-h-patrianna/animations --skill testing-anti-patterns-michael-h-patrianna

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses common mistakes in testing that lead to brittle, ineffective, or misleading tests. It helps you avoid scenarios where tests pass but the code is still broken, or where tests are hard to maintain.

Core Features & Use Cases

  • Identify Mocking Issues: Prevents testing mock behavior instead of real code, ensuring your tests provide genuine confidence.
  • Maintain Code Purity: Guides against adding test-only methods to production code, keeping your codebase clean and focused.
  • Use Case: When reviewing a pull request, use this skill to identify if new tests are asserting on mock implementations rather than actual component behavior, ensuring the tests are truly valuable.

Quick Start

Review the attached test file 'user-service.test.ts' for any testing anti-patterns.

Frequently Asked Questions about testing-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid writing tests that pass but don't actually verify real code behavior?

Testing anti-patterns often involve asserting on mock implementations rather than real component behavior. This Skill identifies when tests verify mock behavior instead of actual code, ensuring your tests provide genuine confidence that the system works as intended.

What are common mocking mistakes in JavaScript and TypeScript unit tests?

Common mocking anti-patterns include mocking dependencies without understanding their real side effects, creating test-only production methods, and using incomplete mocks that don't mirror actual API structures. This Skill prevents these pitfalls by enforcing complete mocks and blocking assertions on mock-only code.

How do I keep my production code free of test-only methods?

Test-only methods pollute production codebases and signal design issues. This Skill guides against adding test-specific code to production, maintaining code purity and ensuring your codebase remains focused on actual requirements rather than testing convenience.

Can I use this during code review to catch ineffective tests?

Yes. When reviewing pull requests, use this Skill to identify whether new tests are asserting on mock implementations rather than real component behavior, ensuring tests are genuinely valuable and will catch actual bugs in production.

What testing best practices does this Skill enforce?

This Skill enforces iron laws of testing: verify real component behavior, maintain code purity by avoiding test-only production code, and ensure mocks completely reflect real API structures and side effects, preventing brittle and misleading tests.