testing-anti-patterns

Identify and remediate testing anti-patterns in JavaScript/TypeScript test suites.

1|1|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/rodrigobranas/formacao_ia_arq_t1_4 --skill testing-anti-patterns-rodrigobranas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/rodrigobranas/formacao_ia_arq_t1_4/tree/main/mastra-rag/.agents/skills/test-antipatterns
Command: npx skills add https://github.com/rodrigobranas/formacao_ia_arq_t1_4 --skill testing-anti-patterns-rodrigobranas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests must avoid anti-patterns that degrade reliability, readability, and maintainability of test suites, such as over-mocking, testing mock behavior, or producing test-only production code.

Core Features & Use Cases

  • Identifies common testing anti-patterns (mock overuse, incomplete mocks, testing mocks instead of real behavior).
  • Guides best practices for structuring unit/integration tests with deterministic outcomes and maintainable mocks.
  • Use case: refactor a flaky test suite by removing mock-focused assertions and aligning tests with real behavior.

Quick Start

Run an audit of your test suite to locate anti-patterns and implement fixes that emphasize testing real behavior over mocks.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
What are common testing anti-patterns that make my unit tests flaky?

Common testing anti-patterns include mock overuse, incomplete mocks, testing mock behavior instead of real behavior, and creating test-only production code. These degrade test reliability and maintainability.

How do I refactor a flaky test suite to test real behavior instead of mocks?

To refactor a flaky test suite, audit your tests to locate mock-focused assertions and over-mocking. Remove these anti-patterns and restructure tests to verify real behavior with deterministic outcomes.

How should I structure mocks in JavaScript and TypeScript unit tests?

Structure mocks in JavaScript and TypeScript by avoiding overuse and ensuring they are complete. Guide your test scaffolding to align with production-like behavior, enforcing best practices for maintainable test doubles.

Can I use this approach to fix testing anti-patterns in integration and UI tests?

Yes, the approach identifies and remediates testing anti-patterns across unit, integration, and UI tests. It applies whenever you add mocks, test doubles, or production-like scaffolding to your test suites.

Why should I avoid test-only production code when scaffolding tests?

Test-only production code degrades test suite reliability and readability. Avoiding it prevents anti-patterns by ensuring your test scaffolding and mocks accurately represent real behavior rather than test-specific shortcuts.