useInfiniteQuery not working when testing a component using it #4553
-
Hello everybody! Did anybody experience issues in testing a component that uses an useInfiniteQuery hook? I don't want to test the custom hook itself , I want to check that the data is displayed as expected in the component. I am using Jest + react-native-testing-library + MSW and my setup works perfectly for the My custom hook (and fetch function):
If I add some console logs in the component, I see the following output. The mocked data is successfully returned, but Any idea on how to fix it? Thanks :)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Solved it, it was a misunderstanding on how to pass the response headers through MSW but I figured that out, can be closed. |
Beta Was this translation helpful? Give feedback.
Solved it, it was a misunderstanding on how to pass the response headers through MSW but I figured that out, can be closed.