-
Hi, I am trying to mock my server with conditions so that I can change the response in each test. But getting below result. Somehow when I change the shouldReturnEmpty on third test it does not read it but it affects the 4th test. (Third and forth tests are exactly same.) Why would this happen, is there any better solution for this?
3rd & 4th Tests:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Edit: In case anyone would have this issue in the future, how you need to use waitFor is changed with React 18+, see below. Also clear queryClient after each test! await waitFor(() => expect(result.current.isSuccess).toBe(true)); |
Beta Was this translation helpful? Give feedback.
Edit: In case anyone would have this issue in the future, how you need to use waitFor is changed with React 18+, see below. Also clear queryClient after each test!
await waitFor(() => expect(result.current.isSuccess).toBe(true));