react-testing-library

Simple and complete React DOM testing utilities that encourage good testing practices. More info

Articles & Tutorials

How to test your React apps with the React Testing Library (freecodecamp.org)
Oct 09, 2019
Building web applications is not an easy task as of today. To do so, you're probably using something like React, Vue or Angular. Your app is faster, and the code is both more maintainable and readable.
  • Thomas Lombart
Getting Started with React Testing Library (css-tricks.com)
May 22, 2019
We’re going to spend some time writing tests together using react-testing-library for a light to-do application I built.
  • Kingsley Silas
My experience moving from Enzyme to react-testing-library (medium.com)
May 21, 2019
Hopefully, this post can help you understand some key differences between the two libraries and inspire you to explore them for yourself.
  • David Boyne
Testing Stateful React Function Components with React Testing Library (robertcooper.me)
Apr 08, 2019
In this post, I'll look at an example stateful function component that is tested with react-testing-library. I'll also write the same component into its class component equivalent and show how the class component can be tested with enzyme.
  • Robert Cooper
Async Axios in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll take a look at how to handle async code in React Testing Library, specifically at how to test and mock a call using Axios.
Firing Events in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll see how to fire and test events in our React components using the React Testing Library.
Async MobX in React Testing Library (leighhalliday.com)
Mar 07, 2019
In this article we'll take a look at how to handle async code in React Testing Library, specifically at how to test and mock a call using Axios.
Testing React components (flaviocopes.com)
Jan 05, 2019
Test your first React component using Jest and `react-testing-library`
Introducing the react-testing-library (blog.kentcdodds.com)
Apr 02, 2018
A simpler replacement for enzyme that encourages good testing practices.

Video Guides & Talks

How I like to Write Integration Tests in React (youtube.com)
Jun 15, 2019
I share how I like to write integration tests in React with React Testing Library and Apollo.
React Testing Library - Testing Redux (youtube.com)
Mar 02, 2019
In this video we'll see how to test using Redux and connected components with the React Testing Library.
React Testing Library - Testing a mock Axios request (youtube.com)
Feb 13, 2019
In this video we look at how to test a component with react testing library which contains an asynchronous Axios request that we'll mock out using Jest mocks.
Updating react-testing-library for React 16.8.0 (part 2) (youtube.com)
Feb 06, 2019
Hooks was released along with a special utility for testing React properly. I'm going to update react-testing-library to make it easier for people to test things properly.
Updating react-testing-library for React 16.8.0 (youtube.com)
Feb 05, 2019
React has a new utility for testing and I'm going to update react-testing-library to use that utility.
React Testing Library - Events and Async (youtube.com)
Jan 31, 2019
In this video we'll see how to fire events (click) and how to wait for elements to appear on the screen when the code is asynchronous.
Intro to React Testing Library (youtube.com)
Jan 29, 2019
We'll investigate how to easily test our React components using the React Testing Library an alternative to Enzyme that works alongside Jest. This is an introduction, covering installation, snapshots, finding elements and verifying certain attributes on those elements.
React Hooks & testing: Stepping through React code (youtube.com)
Nov 05, 2018
I'm trying to figure out the best way to simplify testing of React components with react-testing-library.
What Is React Testing Library? (youtube.com)
Aug 29, 2018
In this video I talk about what is React Testing Library and why you might want to use it.
Component Unit Testing (and mocking) with react-testing-library (youtube.com)
Jun 22, 2018
Lots of people make the assumption that react-testing-library is good for React component integration testing, but not very useful for unit testing because it (intentionally) doesn't support shallow rendering. Let's see how you can do unit testing with react-testing-library
render React Components with react-testing-library (youtube.com)
Jun 19, 2018
Now there's only one way to do it, but it can be customized to suite your needs.
Test Driven Development with react-testing-library (youtube.com)
May 22, 2018
The react-testing-library is a very light-weight solution for testing React components.

Courses & Video Series