testing-anti-patterns

Identify and prevent testing anti-patterns in JavaScript/TypeScript projects.

3|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/martin-janci/claude-marketplace --skill testing-anti-patterns-martin-janci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/martin-janci/claude-marketplace/tree/main/plugins/dev-agents/skills/testing-anti-patterns
Command: npx skills add https://github.com/martin-janci/claude-marketplace --skill testing-anti-patterns-martin-janci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested.

Core Features & Use Cases

  • Avoid mocking real behavior: Ensure tests exercise real code paths and dependencies.
  • Eliminate test-only production methods: Remove or isolate test utilities from production code.
  • Guard against incomplete mocks: Replace partial mocks with complete, realistic structures.

Quick Start

Describe a codebase and request guidance on eliminating testing anti-patterns to ensure tests verify real behavior.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
What are common unit testing anti-patterns in JavaScript?

Common unit testing anti-patterns include testing mock behavior instead of real code, creating production methods only used for tests, and using incomplete mocks. This Skill identifies these issues to ensure tests verify actual behavior.

How do I stop testing mock behavior in TypeScript integration tests?

To stop testing mock behavior in integration tests, you must ensure tests exercise real code paths and dependencies. This Skill guides JavaScript and TypeScript developers to replace partial mocks with complete, realistic structures and eliminate mock-centered assertions.

How do I remove test-only production methods from my codebase?

Remove test-only production methods by isolating test utilities from production code. This Skill analyzes your codebase to identify these anti-patterns and provides guidance on eliminating them to maintain clean boundaries between test logic and production logic.

Does this testing guidance apply to Python or Java projects?

No, this guidance specifically applies to unit and integration testing in JavaScript and TypeScript projects. It focuses on preventing mocking anti-patterns and enforcing real-behavior testing within those specific tech stacks.

Why do my unit tests pass but fail in production?

Unit tests may pass but fail in production if they verify mock behavior rather than real behavior. Using incomplete mocks or test-only production methods creates false positives that this Skill helps identify and eliminate.

When should I not use mocking in unit testing?

You should avoid mocking when it undermines test validity or when mocks do not accurately reflect real API structures. This Skill provides guardrails to ensure mocks are complete, well-documented, and used only for isolation rather than being the subject of assertions.