# kentcdodds/react-testing-library

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kentcdodds-react-testing-library).**

19,606 stars · 1,165 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/kentcdodds/react-testing-library
- Homepage: https://testing-library.com/react
- awesome-repositories: https://awesome-repositories.com/repository/kentcdodds-react-testing-library.md

## Description

This project is a component testing framework and utility designed for testing React components. It functions as a DOM testing library that allows for the verification of rendered output and component functionality without accessing internal implementation details.

The library focuses on behavior driven development by simulating user interactions within a virtual DOM environment. It utilizes implementation-agnostic querying to locate elements via accessible roles and labels, ensuring that the interface is verified from the perspective of the user.

The toolset covers frontend integration testing and React DOM validation. It provides capabilities to render components into a simulated browser document, trigger synthetic events, and verify that the resulting HTML output behaves correctly.

## Tags

### Testing & Quality Assurance

- [Implementation-Agnostic Querying](https://awesome-repositories.com/f/testing-quality-assurance/implementation-agnostic-querying.md) — Locates elements using accessible roles and labels instead of internal component state or CSS classes.
- [User Interaction Simulation](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/user-interaction-simulation.md) — Trigger user events on rendered elements to verify the interface behaves correctly from the user's perspective. ([source](https://github.com/kentcdodds/react-testing-library#readme))
- [DOM Simulation Rendering](https://awesome-repositories.com/f/testing-quality-assurance/dom-simulation-rendering.md) — Renders React components into a simulated browser document to verify actual HTML output.
- [DOM Testing Utilities](https://awesome-repositories.com/f/testing-quality-assurance/dom-testing-utilities.md) — Provides utilities for querying and interacting with the DOM to verify accessibility and behavior.
- [DOM Validation](https://awesome-repositories.com/f/testing-quality-assurance/dom-validation.md) — Checks that the correct HTML elements and text are rendered in response to specific application states.
- [Component Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/test-levels-and-types/component-testing-frameworks.md) — Provides a framework to render components and simulate interactions to verify functionality. ([source](https://github.com/kentcdodds/react-testing-library#readme))
- [React Testing Utilities](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/react-testing-utilities.md) — Offers specialized helpers for rendering, querying, and interacting with React components during tests.
- [Frontend Integration Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/test-levels-and-types/component-testing-frameworks/frontend-integration-testing.md) — Validates how different React components interact and maintain accessibility compliance within a controlled environment.
- [Behavior-Driven Testing](https://awesome-repositories.com/f/testing-quality-assurance/testing-best-practices-methodologies/quality-assurance-practices/testing-methodologies/behavior-driven-testing.md) — Focuses tests on user-visible outcomes rather than internal implementation details.

### Programming Languages & Runtimes

- [Node.js DOM Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-dom-implementations.md) — Uses a JavaScript implementation of the DOM to run browser-like tests within a Node.js process.

### User Interface & Experience

- [Testing Utilities](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/testing-utilities.md) — Verifies that React user interface components behave correctly by simulating real user interactions.
- [Event-Driven Interaction Handlers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/general-interaction-frameworks/interaction-models/event-driven-interaction-handlers.md) — Triggers synthetic DOM events to mimic real user behavior and verify interface changes.

### Part of an Awesome List

- [Testing Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/testing-frameworks.md) — Simple and complete React DOM testing utilities that encourage good testing practices.
