Replies: 2 comments 2 replies
-
Hi, @JustSanya. Can you please share a minimal reproduction for this? It's important for me to understand how you construct and run your test to give a proper answer here. Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have the same issue |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am using msw (ver. 1.3.2) server for unit tests and it seems that if success case is run first, handlers, that are supposed to override it, will be ignored.
In the file describing default handlers I have
while in my test I want to check error case:
If I move this kind of test to be run in the beginning, the whole suite passes. If test is run in isolation it will also pass. If I move it to the end, after tests which used default handler run, it will fail because handler override is ignored (it seems to me). Debugger shows that line
return res.once(ctx.status(422), ctx.json({ error: '' }));
is not even executed, whileserver.printHandlers()
shows me that there's additional handler for this route in the beginning of the array. So why is it being registered but not run?Beta Was this translation helpful? Give feedback.
All reactions