Mô tả

Congratulations! You've found the most popular, most complete, and most up-to-date resource online for learning how to test React apps with React Testing Library and Jest!

Thousands of other engineers have learned how to test, and you can too. This course uses a time-tested, battle-proven method to make sure you understand exactly how testing works, and will get you a new job working as a software engineer or help you build that app you've always been dreaming about.

The difference between this course and all the others: you will understand the design patterns used by top companies to test the largest React apps around.

Testing is used to verify your code works as expected. This provides a set of unique benefits to any frontend:

  1. Author smaller, easier to understand codebases

  2. Deploy your code with confidence that it will behave correctly

  3. Test each portion of your app separately - limit the chance of interrupting your users

  4. Allow each of your engineering teams to work independently

  5. Change your codebase without worrying about breaking an existing feature

Testing is a popular topic, but there is a lot of misinformation online. This course has been developed with input from top engineers to ensure total technical accuracy.

----------------------

What will you build?

This course focuses on testing components in a variety of different environments.  You will begin by writing tests for a small mini-project, just to get some quick initial experience.  From there, you'll learn about React Testing Library and all of its functionality by building a series of interactive cheatsheets.  You can use these cheatsheets as a future reference to easily remember the intricacies of testing.  Finally, you'll add tests to a rather large React app, complete with authentication, data fetching, and navigation.

Here's a partial list of some of the topics you'll cover:

  • Customize your test environment by writing custom Jest matchers

  • Learn how to debug your tests by fixing many bugs

  • Run tests faster by implementing a fake data-fetching process

  • Understand best practices by working on a large React project

  • See an exhaustive list of all the functionality packed into React Testing Library

  • Enhance your element-selecting powers by using the ARIA Role system

  • Get experience testing authentication and routing

  • Write more efficient tests by learning dozens of testing shortcuts

  • Finally understand the most mysterious function in React - the 'act' function!

  • Learn multiple ways of handling third-party libraries in a test environment

  • Use Jest to 'mock' functions and libraries

I spent the early years of my software engineering career writing tests non-stop.  Every single day, I practiced Test Driven Development to write thousands of lines of code while being mentored by top industry engineers.  Let me share this knowledge with you.  Testing is one of the topics I am most passionate about, and I want you to get as excited as I am.  Sign up today and join me!

Bạn sẽ học được gì

Everything you need to know about testing React Components using React Testing Library and Jest

Understand how to simulate user events and data fetching in a test environment

Verify your components the way your components work - before deploying them!

Get practical, hands-on experience adding tests to a large React project

Explore hidden aspects of testing that aren't covered in any other testing course

Save time by building your own custom Jest matchers

Focus on learning why best practices exist - and when to break them!

Yêu cầu

  • No testing experience is needed!

Nội dung khoá học

11 sections

Dive In - Let's Get Started!

4 lectures
How to Get Help
01:17
Start Testing... Now!
09:09
A Few Critical Questions
05:30
Join Our Community!
00:07

A Whirlwind Overview of Testing

25 lectures
Project Setup
02:06
Quick Note
00:15
Adding the Form
04:51
Handling User Input
03:02
Rendering the List of Users
05:48
Completed Users Project
00:11
Our First Test
08:22
Element Query System
03:14
Understanding ARIA Roles
03:22
Understanding Jest Matchers
03:05
test was not wrapped in act(...) Warning and Test Failure
01:33
Simulating User Events
05:59
Recording Function Calls
07:40
Introducing Mock Functions
05:19
Querying Elements by Labels
07:03
Testing the UserList
05:31
Getting Help with Query Functions
08:12
Query Function Escape Hatches
06:58
Another Query Function Fallback
06:07
Testing Table Contents
04:12
Avoiding BeforeEach
03:13
Reminder on Async Await and act Warnings
00:29
Testing the Whole App
06:40
A Touch of Test Driven Development
05:37
Feature Implementation
03:11

Understanding Element Roles

8 lectures
Introducing RTL Book
02:29
A Few Notes on RTL Book
03:17
Partial Role List
04:08
Finding Elements by Role
05:32
Finding by Accessible Names
04:37
Linking Inputs to Labels
05:02
Directly Assigning an Accessible Name
05:03
Completed Roles Notebook
00:16

Finding Elements with Query Functions

7 lectures
Deeper into Query Functions
05:24
GetBy, QueryBy, FindBy
08:56
More on Single Queries
06:12
Multiple Element Variations
03:18
When to use These Queries
05:56
When to use Async Queries
06:54
Completed Queries Notebook
00:11

Query Function Suffixes

3 lectures
Query Criteria
08:02
When to Use Each Suffix
06:59
Completed Criteria Notebook
00:11

Matchers in Jest

3 lectures
Diving into Matchers
04:53
Introducing Custom Matchers
03:44
Implementing a Custom Matcher
06:58

Big Project Overview

9 lectures
Required Project Setup - Do Not Skip
00:06
App Overview and Setup
05:33
The Tech in This Project
04:21
The Path Ahead
04:59
A Process for Debugging
08:48
Understanding Data Flowing Into the Component
09:52
Developing a Test and a Fix
08:17
Looping Over Assertions
03:40
Flexible Queries
02:22

The Mysterious 'Act' Function!

13 lectures
Another Bug!
04:48
Analyzing the Data... Again!
07:21
Adding Router Context
07:07
Unexpected State Updates
04:40
Act Included with React Testing Library
05:53
Using Act (Hopefully Not!) with RTL
02:19
Solving the Act Warning
09:57
Module Mocks
05:06
Absolute Last Ditch Act Solution
03:38
Checking the Link Href
02:46
Implementing the Feature
05:21
Checking the Icon
04:20
Checking the Link
03:17

Handling Data Fetching in Tests

9 lectures
Easy Fix, Hard Test
05:45
Options for Testing Data Fetching
05:21
Using a Request Handler
02:50
Initial MSW Setup
11:56
Inspecting the Component State
05:04
Effective Request Testing
11:34
An Issue with Fake Handlers
03:50
Easier Fake Routes - Here's the Goal
05:10
Making a Reusable Create Server Function
07:27

Tests Around Authentication

13 lectures
Testing Authentication
03:09
Understanding the Auth API
06:11
Order of Execution
06:34
Scoping Test Hooks
04:42
Act Warnings... Again!
04:48
Assertions Around Auth Links
04:13
Wait... It Doesn't Work!?
03:46
Limiting Test Execution
04:22
Using Debuggers in Tests
04:28
Test Debugging in Action
08:53
One Last Debugging Hint
03:51
It Is a Caching Issue!
04:28
Solving the Caching Issue
03:16

Bonus!

1 lectures
Bonus!
00:33

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.