Individual skill
react-testing-library
React Testing Library best practices for writing maintainable, user-centric tests. Use when writing, reviewing, or refactoring RTL tests. Triggers on test files, testing patterns, getBy/queryBy queries, userEvent, waitFor, and component testing.
skills/.experimental/react-testing-library/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- testing Derived category
- writing Derived category
- engineering Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
README.mddoc · 4,534 bytesSKILL.mdcore · 6,622 bytesassets/templates/_template.mddoc · 834 bytesmetadata.jsonasset · 983 bytesreferences/_sections.mddoc · 1,768 bytesreferences/a11y-role-queries-verify.mddoc · 1,627 bytesreferences/a11y-test-aria-states.mddoc · 1,745 bytesreferences/a11y-verify-focus.mddoc · 1,519 bytesreferences/anti-container-queries.mddoc · 1,344 bytesreferences/anti-empty-waitfor.mddoc · 1,359 bytesreferences/anti-implementation-details.mddoc · 1,565 bytesreferences/anti-manual-cleanup.mddoc · 1,233 bytesreferences/anti-redundant-roles.mddoc · 1,485 bytesreferences/anti-unnecessary-act.mddoc · 1,292 bytesreferences/assert-accessible-description.mddoc · 1,650 bytesreferences/assert-have-value.mddoc · 1,475 bytesreferences/assert-jest-dom-matchers.mddoc · 1,525 bytesreferences/assert-text-content.mddoc · 1,310 bytesreferences/assert-visible-over-in-document.mddoc · 1,362 bytesreferences/async-await-findby.mddoc · 1,110 bytesreferences/async-findby-over-waitfor.mddoc · 1,306 bytesreferences/async-no-side-effects-waitfor.mddoc · 1,373 bytesreferences/async-single-assertion-waitfor.mddoc · 1,504 bytesreferences/async-waitfor-disappear.mddoc · 1,430 bytesreferences/debug-logroles.mddoc · 1,389 bytesreferences/debug-screen-debug.mddoc · 1,399 bytesreferences/debug-testing-playground.mddoc · 1,348 bytesreferences/query-avoid-testid.mddoc · 1,163 bytesreferences/query-get-vs-query.mddoc · 1,473 bytesreferences/query-label-text-forms.mddoc · 1,216 bytesreferences/query-prefer-role.mddoc · 1,104 bytesreferences/query-role-name-option.mddoc · 1,124 bytesreferences/query-use-screen.mddoc · 1,146 bytesreferences/query-within-scope.mddoc · 1,402 bytesreferences/setup-custom-render.mddoc · 1,831 bytesreferences/setup-fake-timers.mddoc · 1,404 bytesreferences/setup-mock-modules.mddoc · 1,322 bytesreferences/setup-render-hook.mddoc · 1,585 bytesreferences/setup-wrapper-providers.mddoc · 1,317 bytesreferences/struct-arrange-act-assert.mddoc · 1,804 bytesreferences/struct-avoid-beforeeach-render.mddoc · 1,579 bytesreferences/struct-descriptive-names.mddoc · 1,534 bytesreferences/struct-one-behavior-per-test.mddoc · 1,777 bytesreferences/user-await-interactions.mddoc · 1,313 bytesreferences/user-clear-before-type.mddoc · 1,206 bytesreferences/user-keyboard-for-special-keys.mddoc · 1,398 bytesreferences/user-prefer-userevent.mddoc · 1,340 bytesreferences/user-setup-before-render.mddoc · 1,220 bytes
Read excerpt
# React Testing Library Best Practices
Comprehensive testing guide for React components using Testing Library, designed for AI agents and LLMs. Contains 43 rules across 9 categories, prioritized by impact to guide test writing and code review.
## When to Apply
Reference these guidelines when:
- Writing new component tests with React Testing Library
- Selecting queries (getByRole, getByLabelText, etc.)
- Handling async operations in tests (findBy, waitFor)
- Simulating user interactions (userEvent)
- Reviewing tests for anti-patterns and implementation detail testing
## Rule Categories by Priority