Replies: 3 comments
-
anyone? 🌹 |
Beta Was this translation helpful? Give feedback.
0 replies
-
To help diagnose the issue I would recommend adding the beforeAll(() => server.listen({onUnhandledRequest: 'error'})) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm going to configure msw to my cra project, also I'm using the same technologies in it. I faced with a problem in integration msw to my rtk query logic. Is there a well example where can I find a correct solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I am struggling setup a proper test environment with MSW and I would appreciate any kind of help here.
I am using react, redux toolkit, rtk queries, openapi and I would like to integration test the API with jest.
I extracted the business logic from the component using hooks. One part of the exported methods contains an api request. This Is the part I would like to have an integration test for. I set up the server, set my handle and run the test which is ending up "Exceeded timeout of 5000 ms for a test". It looks like that MSW isn't intercepting the request.
I put part of the code below, to get a better understanding of problem.
Does anyone have an Idea, what's the Issue here? Is it because I am using renderHook instead of a classic render?
Many thanks!!
Best req
// businessLogic.hooks.ts
// server
// renderHook Wrapper
// test
Beta Was this translation helpful? Give feedback.
All reactions