DEV Community

Discussion on: Mocking redux useSelector-hook

Collapse
 
sklinov profile image
Sergei

Thanks, Fredrick for the article and Sergey for that comment.
I have a slightly different setup: I've wrapped RTL render with my redux-dynamic-modules provider, so I think there's no need to mock react-redux or useSelector, and all I need to actually mock is the return value of my selector function.

I'm trying to implement it the way shown in your comment, but I'm getting an error that my selector is undefined.