React JS Quiz
HomeBlogPrivacy PolicyContact UsTutorialsNewBuy me a coffee

Testing React Components

  1. 1.What to Test
  2. 2.Queries
  3. 3.Interactions and Async
  4. 4.Mocking and Setup
  5. 🏁 End-of-tutorial quiz
Advertisement
Tutorials/Advanced/Testing React Components

Testing React Components

Write tests that survive refactors: query the way users do, simulate real interaction, handle async updates, and know what is worth mocking.

Level
Advanced
Chapters
4
Exercises
1
Reading time
16 min
Start the tutorial →

What you will cover

  1. 1. What to TestThe guiding principle behind React Testing Library, and what not to bother with.
  2. 2. QueriesFinding elements the way a user would, in priority order.
  3. 3. Interactions and AsyncSimulating real user behaviour and waiting for the result.
  4. 4. Mocking and SetupFaking the network, testing hooks, and a checklist for good tests.
Already know this? Jump to the 8 question quiz →
Advertisement
Advertisement
Support the developer