Skip to content
pproenca avatar

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
View on GitHub

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-role and async-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 -y

Installs 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

PriorityCategoryImpactPrefix
1Query SelectionCRITICALquery-
2Async HandlingCRITICALasync-
3Common Anti-PatternsCRITICALanti-
4User InteractionHIGHuser-
5AssertionsHIGHassert-
6Component SetupMEDIUMsetup-
7Test StructureMEDIUMstruct-
8DebuggingLOW-MEDIUMdebug-
9Accessibility TestingLOWa11y-

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

Similar to React Testing Library

More Testing & QA