Testing React apps with React Testing Library RTL

Learn how to test React components with React Testing Library, the recommended library from Facebook for testing.
Testing React apps with React Testing Library RTL
File Size :
713.99 MB
Total length :
2h 37m

Category

Instructor

David Armendáriz

Language

Last update

2/2021

Ratings

4.3/5

Testing React apps with React Testing Library RTL

What you’ll learn

The principles of Test Driven Development (TDD)
Know what React Testing Library is and its differences with Enzyme
Understand how Jest works with React Testing Library
Query elements with getBy, queryBy, findBy, getAllBy, queryAllBy, findAllBy
Simulate user interaction with the fireEvent and userEvent API
Learn about coverage and debugging
How to mock third party libraries like Axios
How to use Typescript with a React app

Testing React apps with React Testing Library RTL

Requirements

Be famliarized with React components

Description

Welcome to testing React components with React Testing Library! In this course, you will learn lots of things. You will learn:The principles of Test Driven DevelopmentKnow what is React Testing Library (RTL) and its differences with Enzyme (another popular test framework for React)Understand how Create React App (CRA) works.Understand how Jest works with RTLHow to test with RTL and query elements with:getBy, queryBy, findBy, getAllBy, queryAllBy, findAllByHow to simulate user interaction with the fireEvent APIHow to simulate user interaction with the userEvent APITesting components in isolation (unit tests)Learn about coverage and debuggingHow to mock 3rd party libraries like Axios and mock a GET requestLearn about the pitfalls of CRAYou will have all the fundamental tools to test any React component and have that coverage at 100%!Have fun, and never stop learning!

Overview

Section 1: Introduction

Lecture 1 Introduction to TDD

Lecture 2 Introduction to RTL

Section 2: BONUS

Lecture 3 Join the community!

Section 3: Create React App

Lecture 4 The repo for this course

Lecture 5 Create React App behind the scenes

Section 4: Jest

Lecture 6 Understanding Jest

Lecture 7 Writing our first test

Section 5: React Testing Library

Lecture 8 A little mistake!

Lecture 9 Rendering a component with RTL

Lecture 10 Selecting elements with getByText

Lecture 11 Selecting elements with getByRole

Lecture 12 queryBy search variant

Lecture 13 findBy search variant (Part 1)

Lecture 14 findBy search variant (Part 2)

Lecture 15 A little mistake in one of the tests!

Lecture 16 findBy search variant (Part 3)

Lecture 17 Querying multiple elements

Lecture 18 User interaction with the fireEvent function

Lecture 19 User interaction with the user event API

Lecture 20 Testing a component in isolation with the user event API

Section 6: Coverage and debugging

Lecture 21 Coverage

Lecture 22 Debugging

Section 7: A more complex example

Lecture 23 Creating a Pokemon component

Lecture 24 Testing the Pokemon component

Section 8: More custom matchers

Lecture 25 Jest DOM library from RTL

Web developers,Full stack developers,Developers interested in Test Driven Development,Front-end developers

Course Information:

Udemy | English | 2h 37m | 713.99 MB
Created by: David Armendáriz

You Can See More Courses in the Developer >> Greetings from CourseDown.com

New Courses

Scroll to Top