Tired of piecing together disconnected tutorials or dealing with rambling, confusing instructors? This course is for you! It's perfectly structured into a series of bite-sized, easy-to-follow videos that cover both theory and practice.
Testing React Apps with React Testing Library
- Master the fundamentals of testing React applications with React Testing Library.
- Write maintainable, robust, and trustworthy tests that consistently deliver value.
- Efficiently mock API responses with Mock Service Worker (MSW).
- Mock data using @mswjs/data and @faker-js.
- Simulate user events in a test environment.
- Dive into advanced testing techniques involving authentication, state management, routing, etc.
- Master refactoring techniques that pros use to make their code more readable and maintainable.
- Learn from real-world examples and exercises that prepare you for the job.
- Use ESLint to catch code quality issues early.
About the Author: Mosh Hamedani (Code with Mosh)
Mosh Hamedani is the founder of Code with Mosh, one of the highest-volume independent online instructors in software education. He has been publishing courses continuously since the early Udemy era and has taught over a million students across his Udemy catalog and his standalone Code with Mosh platform. His teaching style is patient, rigorously structured, and deliberately beginner-tolerant — the courses are widely cited as some of the most accessible introductions to their respective topics.
The Code with Mosh catalog covers an unusually wide span: web development with HTML / CSS / JavaScript / React / Angular / Node.js, Python and Django, C# and .NET, mobile development with React Native and Flutter, SQL and database fundamentals, and the algorithm / data-structure interview prep tracks. Few independent instructors maintain this much breadth at consistent quality.
The CourseFlix listing under this source carries over 35 Code with Mosh courses spanning that range. Material is paid; Code with Mosh runs on per-course pricing on the original platform. Courses are aimed primarily at developers picking up a new technology from a clean start through to working production proficiency.
Watch Online 84 lessons
| # | Lesson Title | Duration | Access |
|---|---|---|---|
| 1 | Introduction Demo | 01:23 | |
| 2 | Prerequisites | 01:41 | |
| 3 | Course Structure | 01:47 | |
| 4 | How to Take this Course | 01:53 | |
| 5 | Setting Up the Development Environment | 01:01 | |
| 6 | Setting Up the Starter Project | 05:57 | |
| 7 | Setting Up Vitest | 03:49 | |
| 8 | Setting Up React Testing Library | 02:59 | |
| 9 | Introduction | 00:59 | |
| 10 | What to Test | 03:17 | |
| 11 | Testing Rendering | 08:42 | |
| 12 | Simplifying Test Setup | 03:04 | |
| 13 | Exercise- Testing UserAccount | 05:37 | |
| 14 | Testing Lists | 06:06 | |
| 15 | Exercise- Testing ProductImageGallery | 04:22 | |
| 16 | Testing User Interactions | 08:57 | |
| 17 | Exercise- Testing ExpandableText | 11:13 | |
| 18 | Simplifying Tests | 03:02 | |
| 19 | Exercise- Testing SearchBox | 08:36 | |
| 20 | Testing Asynchronous Code | 04:17 | |
| 21 | Exercise- Testing ToastDemo | 03:50 | |
| 22 | Working with Component Libraries | 09:48 | |
| 23 | Exercise- Simplifying Code | 03:51 | |
| 24 | Exercise- Testing OrderStatusSelector | 09:35 | |
| 25 | Is Unit Testing Worth It | 01:48 | |
| 26 | Catching Common Issues with ESLint | 02:25 | |
| 27 | Introduction | 00:39 | |
| 28 | Setting Up Mock Service Worker | 06:54 | |
| 29 | Testing Data Fetching | 06:25 | |
| 30 | Exercise- Testing Data Fetching | 12:29 | |
| 31 | Generating Fake Data | 02:37 | |
| 32 | Mocking Data | 10:05 | |
| 33 | Exercise- Mocking Data | 03:04 | |
| 34 | Testing Errors | 01:58 | |
| 35 | Exercise- Testing Errors | 01:33 | |
| 36 | Testing the Loading State | 05:44 | |
| 37 | Exercise- Testing the Loading State | 00:25 | |
| 38 | Refactoring- Using React Query | 08:36 | |
| 39 | Wrapping Components for Testing | 03:21 | |
| 40 | Exercise- Using React Query | 04:31 | |
| 41 | Exercise- Testing BrowseProductsPage | 02:12 | |
| 42 | Exercise- Testing Loading Skeletons | 10:16 | |
| 43 | Exercise- Testing Error Handling | 05:47 | |
| 44 | Exercise- Testing Data Rendering | 13:28 | |
| 45 | Exercise- Refactoring Tests | 08:37 | |
| 46 | Exercise- Testing Filtering | 07:35 | |
| 47 | Exercise- Refactoring Tests | 10:25 | |
| 48 | Code Coverage | 02:33 | |
| 49 | Exercise- Refactoring with React Query | 08:20 | |
| 50 | Exercise- Extracting CategorySelect | 06:40 | |
| 51 | Exercise- Extracting ProductTable | 03:19 | |
| 52 | Introduction | 00:35 | |
| 53 | What to Test | 01:39 | |
| 54 | Testing Rendering | 08:39 | |
| 55 | Exercise- Testing Initial Data | 03:51 | |
| 56 | Exercise- Refactoring Tests | 06:27 | |
| 57 | Exercise- Testing Focus | 03:17 | |
| 58 | Testing Validation Rules | 03:30 | |
| 59 | Parameterizing Tests | 03:47 | |
| 60 | Exercise- Testing Validation Rules | 03:55 | |
| 61 | Exercise- Extracting a Function for Filling Forms | 10:47 | |
| 62 | Resolving the Act Warning | 03:57 | |
| 63 | Exercise- Testing Form Submission | 07:30 | |
| 64 | Testing Form Feedback | 03:26 | |
| 65 | Introduction | 00:36 | |
| 66 | What to Test | 00:39 | |
| 67 | Exercise- Testing Components that Use Context | 10:50 | |
| 68 | Exercise- Testing Quantity Selector | 17:34 | |
| 69 | Exercise- Extracting Utility Functions | 06:06 | |
| 70 | Exercise- Testing Components that Use Redux | 03:30 | |
| 71 | Exercise- Replacing Redux with React Query | 04:50 | |
| 72 | Introduction | 00:23 | |
| 73 | What to Test | 01:23 | |
| 74 | Mocking the Authentication Status | 05:14 | |
| 75 | Exercise- Testing AuthStatus | 05:06 | |
| 76 | Introduction | 00:19 | |
| 77 | What to Test | 00:28 | |
| 78 | Testing Routes | 07:42 | |
| 79 | Extracting navigateTo | 02:56 | |
| 80 | Exercise- Testing Routes with Parameters | 03:00 | |
| 81 | Exercise- Testing Invalid Routes | 00:51 | |
| 82 | Testing Protected Routes | 03:01 | |
| 83 | Exercise- Testing ProductDetailPage | 04:34 | |
| 84 | Course Wrap Up | 00:26 |
Get instant access to all 83 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.
Learn more about subscriptionBooks
Course content
84 lessons · 6h 48m 20sShow all 84 lessons
- 1 Introduction 01:23
- 2 Prerequisites 01:41
- 3 Course Structure 01:47
- 4 How to Take this Course 01:53
- 5 Setting Up the Development Environment 01:01
- 6 Setting Up the Starter Project 05:57
- 7 Setting Up Vitest 03:49
- 8 Setting Up React Testing Library 02:59
- 9 Introduction 00:59
- 10 What to Test 03:17
- 11 Testing Rendering 08:42
- 12 Simplifying Test Setup 03:04
- 13 Exercise- Testing UserAccount 05:37
- 14 Testing Lists 06:06
- 15 Exercise- Testing ProductImageGallery 04:22
- 16 Testing User Interactions 08:57
- 17 Exercise- Testing ExpandableText 11:13
- 18 Simplifying Tests 03:02
- 19 Exercise- Testing SearchBox 08:36
- 20 Testing Asynchronous Code 04:17
- 21 Exercise- Testing ToastDemo 03:50
- 22 Working with Component Libraries 09:48
- 23 Exercise- Simplifying Code 03:51
- 24 Exercise- Testing OrderStatusSelector 09:35
- 25 Is Unit Testing Worth It 01:48
- 26 Catching Common Issues with ESLint 02:25
- 27 Introduction 00:39
- 28 Setting Up Mock Service Worker 06:54
- 29 Testing Data Fetching 06:25
- 30 Exercise- Testing Data Fetching 12:29
- 31 Generating Fake Data 02:37
- 32 Mocking Data 10:05
- 33 Exercise- Mocking Data 03:04
- 34 Testing Errors 01:58
- 35 Exercise- Testing Errors 01:33
- 36 Testing the Loading State 05:44
- 37 Exercise- Testing the Loading State 00:25
- 38 Refactoring- Using React Query 08:36
- 39 Wrapping Components for Testing 03:21
- 40 Exercise- Using React Query 04:31
- 41 Exercise- Testing BrowseProductsPage 02:12
- 42 Exercise- Testing Loading Skeletons 10:16
- 43 Exercise- Testing Error Handling 05:47
- 44 Exercise- Testing Data Rendering 13:28
- 45 Exercise- Refactoring Tests 08:37
- 46 Exercise- Testing Filtering 07:35
- 47 Exercise- Refactoring Tests 10:25
- 48 Code Coverage 02:33
- 49 Exercise- Refactoring with React Query 08:20
- 50 Exercise- Extracting CategorySelect 06:40
- 51 Exercise- Extracting ProductTable 03:19
- 52 Introduction 00:35
- 53 What to Test 01:39
- 54 Testing Rendering 08:39
- 55 Exercise- Testing Initial Data 03:51
- 56 Exercise- Refactoring Tests 06:27
- 57 Exercise- Testing Focus 03:17
- 58 Testing Validation Rules 03:30
- 59 Parameterizing Tests 03:47
- 60 Exercise- Testing Validation Rules 03:55
- 61 Exercise- Extracting a Function for Filling Forms 10:47
- 62 Resolving the Act Warning 03:57
- 63 Exercise- Testing Form Submission 07:30
- 64 Testing Form Feedback 03:26
- 65 Introduction 00:36
- 66 What to Test 00:39
- 67 Exercise- Testing Components that Use Context 10:50
- 68 Exercise- Testing Quantity Selector 17:34
- 69 Exercise- Extracting Utility Functions 06:06
- 70 Exercise- Testing Components that Use Redux 03:30
- 71 Exercise- Replacing Redux with React Query 04:50
- 72 Introduction 00:23
- 73 What to Test 01:23
- 74 Mocking the Authentication Status 05:14
- 75 Exercise- Testing AuthStatus 05:06
- 76 Introduction 00:19
- 77 What to Test 00:28
- 78 Testing Routes 07:42
- 79 Extracting navigateTo 02:56
- 80 Exercise- Testing Routes with Parameters 03:00
- 81 Exercise- Testing Invalid Routes 00:51
- 82 Testing Protected Routes 03:01
- 83 Exercise- Testing ProductDetailPage 04:34
- 84 Course Wrap Up 00:26
Related courses
-
Updated 2y agoMaster Class: React + Typescript 2021 Web Development
By: UdemyMany new React Developers find ReactJS easy to learn and that is totally true. But the problem is when they are coding complex structures, the code becomes unma22 hours 4 minutes 13 seconds -
Updated 2y agoReact & TypeScript - The Practical Guide
By: Academind Pro (Maximilian Schwarzmüller)TypeScript is an amazing technology that helps developers write better code with less errors - simply because it let's you catch & fix type-related errors.7 hours 22 minutes 54 seconds 5 / 5 -
Updated 2y agoAdvanced Radix UI
By: Build UIRadix UI has become one of the most popular component libraries in the React ecosystem.2 hours 13 minutes 5 seconds 5 / 5