agentleFS
ku5icku5ic/claude-kit/skills/test-patterns/SKILL.md

test-patterns

Skill2 starsChanged 7 days agoMITView on GitHub

Testing conventions for test design, fixtures, mocking, query priority, async handling, behavior-vs-implementation tests, boundary coverage, and what to skip. Use whenever the project contains a test config file (`vitest.config.*`, `jest.config.*`, `playwright.config.*`, `pytest.ini`, `conftest.py`) or a test directory (`tests/`, `__tests__/`, `spec/`), OR the user asks about tests at any level, mocking, fixtures, coverage, or a failing test, in any stack and even if a framework is not named.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Test patterns

Apply the runner-specific reference matching the detected test runner. Principles apply to all stacks.

Reference files

FileCovers
reference/anti-patterns.mdSeverity-labeled anti-patterns: implementation details, async pitfalls, mock abuse
reference/principles.mdTest design principles + Test Pyramid (Fowler) vs Testing Trophy (Dodds)
reference/vitest-and-jest.mdShared Jest / Vitest patterns, runner choice, MSW for HTTP mocking
reference/react-testing-library.mdQuery priority, full priority order, getBy vs queryBy vs findBy semantics
reference/playwright.mdPlaywright patterns, page object, property-based testing (fast-check, hypothesis)
reference/pytest.mdpytest fixtures, parametrize, pytest-django
reference/coverage-and-skip.mdCoverage discipline, what to skip, output expectations

References

Version notes

Checked: 2026-09-26 against https://pypi.org/project/pytest/ and the migration and release pages listed above

  • Vitest 4.x (Context7 /vitest-dev/vitest); the migration guide at vitest.dev lists for the next major: vi.mock / vi.unmock / vi.hoisted must be module-scoped, clearMocks defaults to true, automocked modules return undefined in browser mode. None of the patterns in reference/vitest-and-jest.md depend on the old behavior.
  • Jest 30 (2025-06): --testPathPattern renamed --testPathPatterns; expect aliases removed. pytest 9 (2025-11; 9.1.1 current): fixture visibility now decides precedence over registration order; PytestRemovedIn9Warning is an error.
  • MSW 2: http / HttpResponse replace rest and the req, res, ctx signature. Unchanged.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.