-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server.listen()
called after server.close()
does not mock response
#2370
Comments
server.listen()
called after server.close()
does not mock response
Hi, @vishakha94. Thanks for reporting this. I was able to reproduce this issue in isolation in #2383. Will take a look at whats's wrong once I have a moment. |
Root causeCalling |
I've pushed the fix to the PR. Once the CI is green, I will merge it. |
Released: v2.6.8 🎉This has been released in v2.6.8! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Thanks @kettanaito! |
Prerequisites
Environment check
msw
versionNode.js version
v2.6.6
Reproduction repository
vishakha94@b90344e
Reproduction steps
npm run test:node
Current behavior
We have a NextJS app that implements mocking using feature flag. When we switch the flag off for mocking, we call server.close() and if the feature flag is enabled again, serve.listen() is called.
I observed the following:
Our NextJS app setup is complicated, but I was able to reproduce the issue here: https://github.com/vishakha94/msw/tree/repro-server-close
I ran
npm run test:node
Expected behavior
Expect for MSW to resume mocking after server.listen() is called after sever.close().
The text was updated successfully, but these errors were encountered: