test-patterns
Skill2 starsChanged 54 days agoMITView on GitHub
Testing conventions - 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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- atuljha23/holocrontheir own version, first seen Apr 22, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- atuljha23/holocron★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- auditSkill
- backup-patternsSkill
- bash-patternsSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- drf-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- javascript-patternsSkill
- logging-patternsSkill
- referenceSkill
- metaSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- opentofu-patternsSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- security-patternsSkill
- storybook-patternsSkill
- tailwind-patternsSkill
- typescript-patternsSkill
- vps-provisioningSkill
- vue-patternsSkill
- wcag-auditSkill
- writeSkill
The file
Files
Test patterns
Apply the runner-specific reference matching the detected test runner. Principles apply to all stacks.
Reference files
| File | Covers |
| reference/anti-patterns.md | Severity-labeled anti-patterns: implementation details, async pitfalls, mock abuse |
| reference/principles.md | Test design principles + Test Pyramid (Fowler) vs Testing Trophy (Dodds) |
| reference/vitest-and-jest.md | Shared Jest / Vitest patterns, runner choice, MSW for HTTP mocking |
| reference/react-testing-library.md | Query priority, full priority order, getBy vs queryBy vs findBy semantics |
| reference/playwright.md | Playwright patterns, page object, property-based testing (fast-check, hypothesis) |
| reference/pytest.md | pytest fixtures, parametrize, pytest-django |
| reference/coverage-and-skip.md | Coverage discipline, what to skip, output expectations |
References
- Vitest: https://vitest.dev/
- Jest: https://jestjs.io/
- React Testing Library: https://testing-library.com/docs/react-testing-library/intro/
- Testing Library guiding principles: https://testing-library.com/docs/guiding-principles/
- Playwright: https://playwright.dev/
- pytest: https://docs.pytest.org/en/stable/
- pytest-django: https://pytest-django.readthedocs.io/
- Kent C. Dodds (Testing Trophy): https://kentcdodds.com/blog/the-testing-trophy-and-testing-classifications
- Martin Fowler (Test Pyramid): https://martinfowler.com/articles/practical-test-pyramid.html
- MSW: https://mswjs.io/
- fast-check: https://github.com/dubzzz/fast-check
- hypothesis: https://hypothesis.readthedocs.io/en/latest/
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.hoistedmust be module-scoped,clearMocksdefaults to true, automocked modules returnundefinedin browser mode. None of the patterns inreference/vitest-and-jest.mddepend on the old behavior. - Jest 30 (2025-06):
--testPathPatternrenamed--testPathPatterns;expectaliases removed. pytest 9 (2025-11; 9.1.1 current): fixture visibility now decides precedence over registration order;PytestRemovedIn9Warningis an error. - MSW 2:
http/HttpResponsereplacerestand thereq, res, ctxsignature. Unchanged.
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
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.

