React Testing: Unit Testing React and E2E Testing
Introduction
Why testing?
(02:20)
Source code under the video
(00:16)
Setting up project
(03:52)
What editor to use?
(01:24)
Unit Testing
What is unit testing?
(01:54)
Setting up Vitest
(08:56)
Testing utilities and helpers
(04:31)
Testing a simple component
(07:00)
Testing inputs and outputs
(09:56)
Mock and Spy functions
(09:15)
Testing useState hook
(06:36)
Testing useEffect with API calls
(11:36)
Testing a simple custom hook
(05:51)
Testing a complex custom hook
(07:56)
Real React project - testing React context
(21:01)
Real React project - testing header component
(08:06)
Real React project - testing footer component
(08:56)
Real React project - adding custom render
(03:20)
Real React project - testing todo component
(12:24)
Real React project - testing main component
(12:06)
Testing setTimeout in React
(04:54)
Testing Redux
Testing reducers
(08:19)
Testing components with Redux store
(07:52)
E2E testing
What is E2E testing
(02:00)
Real React project - E2E testing user interactions
(18:19)
Homework
Homework
(00:36)
Source code under the video