
React Testing Library
This is the go-to library for testing React components the way users actually interact with them. Instead of poking at component internals or state, you query elements by their accessible roles, labels, and visible text, then simulate real user events like typing and clicking. The query priority system pushes you toward getByRole and getByLabelText first, falling back to test IDs only when semantic queries won't work. It includes async utilities for waiting on elements that appear after data loads, and the user-event library over fireEvent for more realistic interactions. The philosophy is simple: if your test doesn't resemble how someone uses your UI, it's probably testing the wrong thing.
- skills.sh installs
- 1.4K
- GitHub stars
- 23
- last updated
- Aug 21, 2026
Install
$ npx -y skills add itechmeat/llm-code --skill react-testing-library --agent claude-codeInstalls into .claude/skills of the current project.
Files
React Testing Library Skill
Quick Navigation
| Topic | Link |
|---|---|
| Queries | references/queries.md |
| User Events | references/user-events.md |
| API | references/api.md |
| Async | references/async.md |
| Debugging | references/debugging.md |
| Config | references/config.md |
Installation
Install: npm install --save-dev @testing-library/react @testing-library/dom. Recommended extras: @testing-library/user-event and @testing-library/jest-dom. React 19 requires v16.1.0+.
Core Philosophy
"The more your tests resemble the way your software is used, the more confidence they can give you."
Avoid testing:
- Internal state of components
- Internal methods
- Lifecycle methods
- Child component implementation details
Test instead:
Sponsors
Details
- Repository
- github.com/itechmeat/llm-code
- Categories
- Frontend Development, Backend & APIs, Testing & QA, Documentation, AI & Agent Building, Design & UI/UX
- First seen
- May 16, 2026