Replies: 2 comments
|
anyone? 🌹 |
0 replies
|
To help diagnose the issue I would recommend adding the beforeAll(() => server.listen({onUnhandledRequest: 'error'})) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
All reactions