Yusinto Ngadiman
March 02, 2019·1 min read

Test React useEffect with Enzyme

hero

To test the useEffect hook with enzyme, you'll need to use a combination of the new react-dom/test-utils method act with enzyme mount. Shallow rendering does not trigger componentDidMount so that won't work.