CodeZettaInterview Hub

React · Hooks · Junior · Live Coding

How do you test a custom hook?

Short Interview Answer

Use renderHook from Testing Library; assert returned values after act updates.

Detailed Explanation

Mock dependencies. Cover edge cases and cleanup.

Did you know this answer?