DEV Community

Discussion on: Mocking redux useSelector-hook

Collapse
 
thisthat90 profile image
thisthat

Instead of requireActual, can we use Jest.spyOn? For me, the below code seems to work fine.

jest
.spyOn(Redux, "useSelector")
.mockImplementation((callback) => callback(mockAppState));