Test function inside useEffect
I am testing my components using Jest and React Testing Library. The current code is updating a title in the TopBar component based on scroll position and current collection title:
Should I manually call unmount of renderHook in react-testing-library?
React Testing library docs say it’s not needed to do cleanups after every test, but for the renderHook
docs don’t say anything if unmount is called after test ends.