QualityTypeScript

Testing Anti-Patterns

by microsoft

Testing Anti-Patterns is a Quality skill for Claude Code, published by microsoft in FluidFramework.

4.9K stars583 forkson microsoft/FluidFrameworkAdded 2026/07/19Repository updated 2026/08/06
collaborationcrdtdatastructuredistributedfluidfluid-frameworkmicrosoftrealtime
Install in seconds
Install Testing Anti-Patterns
Copy Testing Anti-Patterns into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/microsoft/FluidFramework/tree/main/.agency/plugins/nori/skills/testing-anti-patterns ~/.claude/skills/testing-anti-patterns

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/microsoft/FluidFramework.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.agency/plugins/nori/skills/testing-anti-patterns/SKILL.md in microsoft/FluidFramework
Installs to
~/.claude/skills/testing-anti-patterns
Collection
One of 31 skills cataloged from this repository
Category
Quality1897 skills

What Testing Anti-Patterns does

Prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies. Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code.

Testing Anti-Patterns is cataloged under Quality on DirSkills. Testing Anti-Patterns comes from a repository tagged collaboration, crdt, datastructure, distributed and fluid.

Documentation

README

Testing Anti-Patterns

Overview

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

Core principle: Test what the code does, not what the mocks do.

Following strict TDD prevents these anti-patterns.

The Iron Laws

1. NEVER test mock behavior
2. NEVER add test-only methods to production classes
3. NEVER mock without understanding dependencies

Anti-Pattern 1: Testing Mock Behavior

The violation:

// ❌ BAD: Testing that the mock exists
test('renders sidebar', () => {
  render(<Page />);
  expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
});

Why this is wrong:

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Testing Anti-Patterns

  • What else does microsoft publish alongside Testing Anti-Patterns?

    Testing Anti-Patterns is one of 31 skills that DirSkills catalogs from microsoft/FluidFramework, the repository it ships in. Its siblings there include API Changes Review, Brainstorming and Building UI/UX. Each one is a separate skill with its own page in this directory, installs the same way Testing Anti-Patterns does, and is maintained by microsoft in that same repository. The rest of the collection is listed on the microsoft/FluidFramework page.

  • How does Testing Anti-Patterns compare to other Quality skills?

    Testing Anti-Patterns ranks #303 by stars among the 1897 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Testing Anti-Patterns against them. Open each page to compare what they document and how they install.

More from microsoft/FluidFramework

Testing Anti-Patterns is one of 31 skills cataloged on DirSkills from microsoft/FluidFramework.

See all 31 skills