How to Test React Hooks (The Async Ones)

An adventure in patience

Luke Ghenco
Oct 16, 2019 · 6 min read

As I have started writing new code using React hooks, I have noticed some occasional issues when testing components with async calls using the React.useEffect. I wanted to share some examples of some tricks I have learned and implemented in my own code.