React Testing Library
Best-practice guide with 43 rules for writing user-centric React Testing Library tests and reviewing them for anti-patterns.
- CCM score
- 50 of 100
- skills.sh installs
- 433
- GitHub stars
- 228
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers query selection, async handling, user interaction, assertions, component setup, test structure, debugging, and accessibility testing across 9 prioritized categories
- Lists 43 rules, each linked to its own reference file with explanations and code examples, such as
query-prefer-roleandasync-findby-over-waitfor - Enforces getByRole over getByTestId, userEvent over fireEvent, and testing behavior rather than implementation details
- Designed for AI agents and developers writing, reviewing, or refactoring tests that use getBy/queryBy queries, userEvent, and waitFor
Install
$ npx -y skills add pproenca/dot-skills --skill react-testing-library -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Query Selection | CRITICAL | query- |
| 2 | Async Handling | CRITICAL | async- |
| 3 | Common Anti-Patterns | CRITICAL | anti- |
| 4 | User Interaction | HIGH | user- |
| 5 | Assertions | HIGH | assert- |
| 6 | Component Setup | MEDIUM | setup- |
| 7 | Test Structure | MEDIUM | struct- |
| 8 | Debugging | LOW-MEDIUM | debug- |
| 9 | Accessibility Testing | LOW | a11y- |
Quick Reference
1. Query Selection (CRITICAL)
Details
- Repository
- github.com/pproenca/dot-skills
- Categories
- Testing & QA, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What is the react-testing-library skill for?
The react-testing-library skill gives an agent best practices for writing maintainable, user-centric React Testing Library tests. It covers 43 rules across 9 categories, including query selection, async handling, user interaction and assertions.
How do I install the react-testing-library skill?
Run npx -y skills add pproenca/dot-skills --skill react-testing-library -y in your project. Once installed, react-testing-library guides the agent when it writes, reviews or refactors RTL tests.
Which tests should react-testing-library help with?
react-testing-library is meant for writing, reviewing and refactoring RTL tests, including getBy and queryBy queries, userEvent interactions and waitFor calls. It also helps agents avoid testing implementation details.
Where does react-testing-library sit in the Testing & QA category?
react-testing-library is listed in the Testing & QA category on Claude Marketplaces, alongside tdd, webapp-testing and break-ui. Its focus is narrower than general test-driven development, centering on React Testing Library query and async patterns.
More from pproenca/dot-skills
All 100- Expo React Native Coder426
- Jscodeshift426
- Tdd426
- Humanize422
- React Optimise414
- Knip Deadcode412
- Rails Hotwire391
- Ts Google389
- Nginx C Module Design386
- Nginx C Modules383
- Vite380
- Audio Voice Recovery371
- Ios Animations369
- Dockerfile Optimise365
- Uniwind358
- Orval351
- 37signals Rails350
- Ast Grep349
- Codemod344
- Mui Base344
- Skill Authoring343
- Vhs340
- Unix Cli337
- 12 Factor App336
Similar to React Testing Library
More Testing & QAreact-native-testingcallstackincubator/agent-skills102 installsAuthoritative guide for writing React Native component tests with RNTL v13 and v14 version-specific references.
playwrightpproenca/dot-skills1.2K installsCurated Playwright testing guide for Next.js apps covering selectors, auth reuse, mocking, and hydration.
jest-react-testingmanutej/luxor-claude-marketplace1.2K installsComprehensive Jest and React Testing Library guidance for configuration, mocking, async, and hook tests.
react-testingaffaan-m/ecc8.5K installsBehavior-focused React component, hook, and page tests with RTL, MSW mocking, and axe accessibility checks.
playwright-coretestdino-hq/playwright-skill1.2K installsOpinionated Playwright testing guide spanning 50 references for E2E, API, visual, accessibility, and debugging work.