Testing gives you confidence that your code actually works, and keeps working as you change it. This module starts with fast, focused unit tests, moves into testing React components the way a user would interact with them, and finishes with end-to-end tests that check a whole flow in a real browser.
Good tests catch regressions before your users do. Work through these lessons in order, then move on to Accessibility to make sure your app works for everyone.
What automated tests catch that manual clicking around doesn't, and the different types of tests you'll write.
Writing your first tests with a runner like Jest or Vitest, and structuring a test file.
Writing clear assertions, and why functions without side effects are the easiest place to start testing.
Faking network calls, timers, and modules so your tests stay fast and predictable.
Rendering components in a test environment and asserting on what the user would actually see.
Testing how multiple pieces work together, sitting between fast unit tests and slower end-to-end tests.
Automating a full user flow in a real browser with tools like Cypress or Playwright.