testing-anti-patterns

Detect testing anti-patterns in TypeScript and JavaScript test files.

Updated Dec 2, 2025
One-click install
npx skills add https://github.com/m16khb/claude-integration --skill testing-anti-patterns-m16khb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/m16khb/claude-integration/tree/main/.claude/skills/superpowers/testing-anti-patterns
Command: npx skills add https://github.com/m16khb/claude-integration --skill testing-anti-patterns-m16khb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies and prevents common testing anti-patterns, ensuring tests validate real behavior rather than mocks.

Core Features & Use Cases

  • Mock quality discipline: Avoid testing mocks or partial mocks.
  • Production cleanliness: Do not add test-only methods to production code.
  • Integration hygiene: Mock only when dependencies are fully understood.
  • Usage Scenario: Review a test to ensure it evaluates real behavior rather than mocks.

Quick Start

Audit a test file for mock usage and refactor to verify real behavior.

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 testing mock behavior instead of real code?

Testing mock behavior validates the mock itself rather than production logic. This Skill detects when tests verify mock calls or responses instead of actual system behavior, guiding you to refactor tests to exercise real dependencies and assert on genuine outcomes.

Why shouldn't I add test-only methods to production code?

Test-only production methods create hidden APIs, inflate surface area, and couple production to test concerns. This Skill identifies such methods and enforces production cleanliness by requiring tests to work with public APIs only.

How do I know when mocking is appropriate?

Mocking is appropriate only when dependencies are fully understood and external. This Skill enforces integration hygiene by checking that mocks are applied deliberately, not reflexively, preventing shallow test suites that miss real integration failures.

Can I use this for TypeScript and JavaScript projects?

Yes. This Skill detects anti-patterns in TypeScript and JavaScript tests, including mock abuse, test-only production code, and incomplete dependency understanding across both ecosystems.

What's the difference between testing mocks and testing real behavior?

Testing mocks verifies that your mock was called correctly—a tautology that breaks when real dependencies behave differently. Testing real behavior validates that your code works with actual systems, catching integration bugs mocks hide.

How do I audit an existing test file for these anti-patterns?

Review your test for mock verification statements, test-only helper methods in production files, and mocks of internal or insufficiently understood dependencies. This Skill applies gate-style checks during test review or modification to flag and guide refactoring of these issues.