Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of React Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/karthikrshet-react-testing)
---
name: react-testing
description: "Write and fix tests in React: use Testing Library and query by role/label, mocking at boundaries, async tests and CI settings."
tags: [frontend, testing]
---
# React Testing
## When to use
- Writing or reviewing React tests
- Setting up a test suite
- Fixing slow or flaky tests
## Procedure
1. Use Testing Library and query by role/label
2. Test behaviour through user events (user-event)
3. Mock network with MSW
4. Avoid testing implementation details (state, internals)
5. Add a few Playwright journeys for critical flows
## Checklist
- [ ] Accessible queries used
- [ ] Async UI awaited with findBy
## Anti-patterns
- Snapshot tests as the main strategy
- Querying by class names