react-testing-library logo

react-testing-library

A lightweight solution for testing React components
76
60
+ 1
2

What is react-testing-library?

It is a simple and complete React DOM testing utility that encourage good testing practices. It provides light utility functions on top of react-dom and react-dom/test-utils, in a way that encourages better testing practices.
react-testing-library is a tool in the Testing Frameworks category of a tech stack.
react-testing-library is an open source tool with 12.4K GitHub stars and 657 GitHub forks. Here’s a link to react-testing-library's open source repository on GitHub

Who uses react-testing-library?

Companies
21 companies reportedly use react-testing-library in their tech stacks, including Graphy, Zé Delivery, and Frontend.

Developers
48 developers on StackShare have stated that they use react-testing-library.

react-testing-library Integrations

Pros of react-testing-library
Public Decisions about react-testing-library

Here are some stack decisions, common use cases and reviews by companies and developers who chose react-testing-library in their tech stack.

I'm working as one of the engineering leads in RunaHR. As our platform is a Saas, we thought It'd be good to have an API (We chose Ruby and Rails for this) and a SPA (built with React and Redux ) connected. We started the SPA with Create React App since It's pretty easy to start.

We use Jest as the testing framework and react-testing-library to test React components. In Rails we make tests using RSpec.

Our main database is PostgreSQL, but we also use MongoDB to store some type of data. We started to use Redis  for cache and other time sensitive operations.

We have a couple of extra projects: One is an Employee app built with React Native and the other is an internal back office dashboard built with Next.js for the client and Python in the backend side.

Since we have different frontend apps we have found useful to have Bit to document visual components and utils in JavaScript.

See more
Shared insights
on
react-testing-libraryreact-testing-library

Hi, I am starting out to test an application that is currently being developed - FE: React. BE: Node JS. I want the framework to be able to test all UI scenarios (from simple to complex) and also have the capability to test APIs. I also need to run tests across all OSs and Browsers (Windows, Mac, Android, iOS). I have also looked into react-testing-library and @TestProject.io. Any advice you can give as to which framework would be best and why would be so much appreciated! Thank you!!

See more

react-testing-library's Features

  • light-weight solution for testing
  • React DOM testing utilities
  • works with any environment that provides DOM APIs

react-testing-library Alternatives & Comparisons

What are some alternatives to react-testing-library?
react-testing-library
It is a simple and complete React DOM testing utility that encourage good testing practices. It provides light utility functions on top of react-dom and react-dom/test-utils, in a way that encourages better testing practices.
Enzyme
Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
Cypress
Cypress is a front end automated testing application created for the modern web. Cypress is built on a new architecture and runs in the same run-loop as the application being tested. As a result Cypress provides better, faster, and more reliable testing for anything that runs in a browser. Cypress works on any front-end framework or website.
Jest
Jest provides you with multiple layers on top of Jasmine.
JUnit
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
See all alternatives

react-testing-library's Followers
60 developers follow react-testing-library to keep up with related blogs and decisions.
jewseppi
Ron Brueher
Mustafa Guldemir
Vinita Gupta
Jerald Selvaraj
edisplay
christest christest
Maya Uribe
t a
Juan Álvarez Martínez