React Testing Library and Jest: The Complete Guide
-
Dive In – Let’s Get Started!
-
A Whirlwind Overview of TestingProject Setup0sQuick NoteAdding the Form0sHandling User Input0sRendering the List of Users0sCompleted Users ProjectOur First Test0sElement Query System0sUnderstanding ARIA Roles0sUnderstanding Jest Matchers0stest was not wrapped in act(…) Warning and Test FailureSimulating User Events0sRecording Function Calls0sIntroducing Mock Functions0sQuerying Elements by Labels0sTesting the UserList0sGetting Help with Query Functions0sQuery Function Escape Hatches0sAnother Query Function Fallback0sTesting Table Contents0sAvoiding BeforeEach0sReminder on Async Await and act WarningsTesting the Whole App0sA Touch of Test Driven Development0sFeature Implementation0s
-
Understanding Element Roles
-
Finding Elements with Query Functions
-
Query Function Suffixes
-
Matchers in Jest
-
Big Project Overview
-
The Mysterious ‘Act’ Function!Another Bug!0sAnalyzing the Data… Again!0sAdding Router Context0sUnexpected State Updates0sAct Included with React Testing Library0sUsing Act (Hopefully Not!) with RTL0sSolving the Act Warning0sModule Mocks0sAbsolute Last Ditch Act Solution0sChecking the Link Href0sImplementing the Feature0sChecking the Icon0sChecking the Link0s
-
Handling Data Fetching in Tests
-
Tests Around AuthenticationTesting Authentication0sUnderstanding the Auth API0sOrder of Execution0sScoping Test Hooks0sAct Warnings… Again!0sAssertions Around Auth Links0sWait… It Doesn’t Work!?0sLimiting Test Execution0sUsing Debuggers in Tests0sTest Debugging in Action0sOne Last Debugging Hint0sIt Is a Caching Issue!0sSolving the Caching Issue0s
-
Thanks for taking this course
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:
Author smaller, easier to understand codebases
Deploy your code with confidence that it will behave correctly
Test each portion of your app separately – limit the chance of interrupting your users
Allow each of your engineering teams to work independently
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!
What's included
- 7.5 hours on-demand video
- 11 articles
- 56 downloadable resources
- Access on mobile and TV
- Certificate of completion