Closed Devecor closed 3 weeks ago
Judging from the screenshot, you run into the default retries and they take too long for a test with exponential backoff. Turn off retries in tests: https://tkdodo.eu/blog/testing-react-query#turn-off-retries
Thanks! that works. I'l close this
Describe the bug
useQuery will keep in pending when I mock a http call with nock:
and
return Promise.reject()
will also get it stuck in pending.Your minimal, reproducible example
https://github.com/Devecor/test-react-query
Steps to reproduce
Expected behavior
useQuery finished with
error
statusHow often does this bug happen?
None
Screenshots or Videos
Platform
Tanstack Query adapter
react-query
TanStack Query version
5.35.5
TypeScript version
No response
Additional context
No response