DEV Community

Discussion on: How I'm testing my custom React Hook with Enzyme and Jest

Collapse
 
mikeborozdin profile image
Mike Borozdin

If you want to use shallow rendering for unit testing components that rely on useEffect(), I suggest you use the jest-react-hooks-shallow library. It brings React Hooks, such as useEffect() to shallow rendering.

Collapse
 
yaireo profile image
Yair Even Or

it's for jest and not mocha :) many companies use mocha as engine