Mock useIsFetching in Jest
Hi, I know it is recommended to not mock React Query directly in your unit tests, but mock the network calls instead. This is what I do in 99% of my tests, but there are a few cases where I do mock hooks like
useIsFetching
and useIsMutating
directly:
I'm migrating to v5 and now my tests fail with the following error: TypeError: Cannot redefine property: useIsMutating
. Is there a better way to do mocks like this?0 Replies