testing-anti-patterns

Identify and prevent testing anti-patterns in unit, integration, and UI tests.

1|1|Updated Sep 22, 2025
One-click install
npx skills add https://github.com/SkogAI/skillsandknowledge --skill testing-anti-patterns-skogai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/SkogAI/skillsandknowledge/tree/main/actions/testing-anti-patterns
Command: npx skills add https://github.com/SkogAI/skillsandknowledge --skill testing-anti-patterns-skogai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams prevent testing anti-patterns that undermine real behavior by focusing on testing outcomes rather than mocks, reducing production pollution from test-only methods, and improving test reliability.

Core Features & Use Cases

  • Guidelines for evaluating mock usage: Avoid asserting on mock existence and ensure tests verify real component behavior.
  • Strategies to prevent test-only production code: Move test utilities out of production paths and keep production code clean.
  • Practical remediation examples: Replace brittle mocks with tests that reflect actual dependencies and behavior.

Quick Start

Review your test suites to identify any assertions against mocks, remove test-only production code, and prefer testing real behavior over mock surfaces. Example: update a test that asserts "renders with mock" to instead assert on visible UI and 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 testing anti-patterns that undermine real behavior?

Avoid asserting on mock existence and remove test-only production code by moving test utilities out of production paths. Replace brittle mocks with tests that reflect actual dependencies and verify visible behavior.

How do I prevent test-only methods from polluting my production code?

Ensure complete mock data structures and prefer testing real behavior over mock surfaces. Update tests that assert mock interactions to instead assert on visible UI and actual component behavior.

Why should I test real behavior instead of asserting on mock surfaces?

Evaluate mock usage by checking if tests assert on mock existence rather than real component behavior. Ensure mock data structures are complete and move test utilities out of production paths to keep code clean.

Can I use this approach for unit, integration, and UI tests?

Review your test suites to identify assertions against mocks, remove test-only production code, and prefer testing real behavior. For example, update a test that asserts 'renders with mock' to assert on visible UI behavior instead.