Testing Anti-Patterns

Identify and mitigate testing anti-patterns in JavaScript/TypeScript unit and integration tests.

8|1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/gujiachun-rainbow/RainClaw --skill testing-anti-patterns-gujiachun-rainbow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Anti-Patterns
Source: https://github.com/gujiachun-rainbow/RainClaw/tree/main/.trae/skills/testing-anti-patterns
Command: npx skills add https://github.com/gujiachun-rainbow/RainClaw --skill testing-anti-patterns-gujiachun-rainbow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies and remedies common testing anti-patterns that degrade reliability, such as testing mocks instead of real behavior or embedding test-only methods in production code.

Core Features & Use Cases

  • Detects mock-focused assertions, incomplete mocks, and over-mocked dependencies.
  • Guides safe mocking practices, test utility organization, and proper separation of concerns.
  • Applicable to unit, integration, and end-to-end test suites across JavaScript/TypeScript projects.

Quick Start

Audit your test suite to identify and remediate anti-patterns in mocks, test utilities, and integration tests.

Frequently Asked Questions about Testing Anti-Patterns

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

FAQPage Schema
How do I identify testing anti-patterns in my unit and integration tests?

Testing anti-patterns like mock-focused assertions and over-mocked dependencies degrade test reliability. You can identify them by auditing your test suite for incomplete mocks and test-only methods embedded in production code.

What are safe mocking practices for JavaScript and TypeScript projects?

Safe mocking practices require explicit guardrails, proper separation of concerns, and validation to ensure dependencies are not over-mocked. This approach enforces documenting best practices to prevent testing mocks instead of real behavior.

How do I refactor integration tests with test utilities and proper separation of concerns?

Refactor integration tests by organizing test utilities correctly and enforcing proper separation of concerns between test and production logic. This mitigates anti-patterns by ensuring integration scenarios validate real behavior safely.

Why are my unit tests failing to catch bugs despite high coverage?

Unit tests with high coverage fail to catch bugs when anti-patterns like testing mocks instead of real behavior are present. Over-mocked dependencies and incomplete mocks create false confidence by validating mock interactions rather than actual application logic.

Can I use this testing anti-patterns guidance for end-to-end test suites?

Yes, the guidance for detecting and remediating testing anti-patterns is applicable to unit, integration, and end-to-end test suites across JavaScript and TypeScript projects. It helps govern safe mocking and test utility organization.