Course lesson

Test Effects Generated from React the useEffect Hook

NOTE: React Suspense for data fetching is VERY ALPHA and this API is undocumented, unsupported, and will likely change.

Duration
4 min
Access
Free
Transcript
Available

NOTE: React Suspense for data fetching is VERY ALPHA and this API is undocumented, unsupported, and will likely change.

Our Counter component has grown in complexity and we need to figure out how to get it tested. In this lesson, we'll learn how to test the effects that are generated with useEffect.

We'll cover:

  • How React schedules callbacks after the component renders
  • Keeping our tests isolated with afterEach