Loading

That setup function is pretty handy. Seems like a good opportunity for an abstraction. Well, we already have one! It’s called React Hooks Testing Library. Let’s swap our setup function for the renderHook function from @testing-library/react-hooks.

Transcript

Test a Custom React Hook with renderHook from React Hooks Testing Library