How to test the queryClient?
Hey everyone. I have recently dont the react-query course on ui.dev (highly recommend it by the way and cant wait for the rest of it to come out)
Something I am wondering is how would I go about testing stuff in the queryClient. I have a hook that changes options after x time (like the usePolling hook) and in the course they have a way to test that the queryClient to check what the query options are. I am just wondienrg how might I go about doing that?
1 Reply
stormy-gold•14mo ago
The course will have a testing section, but generally, we just render a component that uses a query and expect some results to show up with the network being mocked. Not sure why we would to test the queryClient itself? We have tests for it inside the library 😅