Testing React Apps with Jest and React Testing Library

This course helps you to learn Jest & React testing library to write robust, automated tests for your React app, increasing confidence and code quality.

Intermediate

52 Lessons

16h

Certificate of Completion

This course helps you to learn Jest & React testing library to write robust, automated tests for your React app, increasing confidence and code quality.

AI-POWERED

Explanations

AI-POWERED

Explanations

This course includes

89 Playgrounds
7 Quizzes

This course includes

89 Playgrounds
7 Quizzes

Course Overview

The skills acquired from this course will allow you to write automated tests on your React app using Jest and React Testing Library, which are the de-facto testing tools for React. These tests will allow you to ship new versions of your app with confidence. The tests will also allow you to increase your release frequency, allowing you to get features to your customers quicker. You will learn how to write robust tests that are resilient to breaking when code is improved and refactored, reducing maintenance ...Show More

TAKEAWAY SKILLS

Javascript

Testing

Quality Assurance

React

Jest

What You'll Learn

You will learn about testing React applications with Jest.

You will get hands-on experience with the React Testing Library.

What You'll Learn

You will learn about testing React applications with Jest.

See more

Course Content

1

Introduction

This chapter presents the importance of automated testing, different test types, and challenges of manual testing to appreciate the value of testing tools.
2

Getting Started with Jest

This chapter provides foundations of testing using Jest, covering setup, asynchronous code, debugging, naming best practices, code coverage, and TypeScript.
3

Using Matchers

This chapter presents the various Jest matchers to verify null, equality, strings, arrays, exceptions, and create reliable snapshots.
4

Getting Started with React Testing Library

This chapter introduces component testing with and without React Testing Library, covering setup, execution, debugging, and optimization for efficient testing.
5

React Testing Library Queries

This chapter presents the various query methods including getBy, findBy, queryBy, form field, and advanced element selection in React Testing Library.
6

Firing Events

7 Lessons

This chapter emphasizes simulating clicks, input, select, file uploads, and hover interactions for robust test coverage.
7

Mocking

8 Lessons

This chapter explores mocking concepts, manual mocking, Jest's mocking functions, spying, module mocking, and manual module mocking for effective testing.
8

Testing Different Types of Components

6 Lessons

This chapter covers testing page-level components, React Router routes, stateless and stateful custom React Hooks for comprehensive test coverage.
9

Appendix

1 Lesson

This chapter outlines the necessary tools and setup for successfully completing the course exercises on your local machine.

Course Author

Trusted by 1.4 million developers working at companies

Anthony Walker

@_webarchitect_

Emma Bostian 🐞

@EmmaBostian

Evan Dunbar

ML Engineer

Carlos Matias La Borde

Software Developer

Souvik Kundu

Front-end Developer

Vinay Krishnaiah

Software Developer

Eric Downs

Musician/Entrepeneur

Kenan Eyvazov

DevOps Engineer

Anthony Walker

@_webarchitect_

Emma Bostian 🐞

@EmmaBostian

Hands-on Learning Powered by AI

See how Educative uses AI to make your learning more immersive than ever before.

Instant Code Feedback

Evaluate and debug your code with the click of a button. Get real-time feedback on test cases, including time and space complexity of your solutions.

AI-Powered Mock Interviews

Adaptive Learning

Explain with AI

AI Code Mentor

FOR TEAMS

Interested in this course for your business or team?

Unlock this course (and 1,000+ more) for your entire org with DevPath