-
I'm using React Native, React-Query, Jest and @testing-library/react-hooks. I've got my unit tests to work by setting global.window and clearing the queryCache after each test. But i also have unit tests for failing queries. But they fail at the moment and i narrowed this down to the Or alternatively; how do you wait for all 3 retries? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Can you can configure the queryCache and just set Possibly by wrapping the component in a custom query provider during testing: https://react-query.tanstack.com/docs/api/#reactquerycacheprovider |
Beta Was this translation helpful? Give feedback.
-
@TkDodo thanks for your fast reply! |
Beta Was this translation helpful? Give feedback.
-
@TkDodo provided the correct answer in a thread here: #1090 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
@TkDodo provided the correct answer in a thread here: #1090 (reply in thread)