-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
removeInterceptor
with scope as an argument.
#1117
Comments
I also couldn't understand why 'removeInterceptor' didn't work for me... And then I understood that
So issue helped. Don't want to look silly but it was not clear from docs for me. |
Thanks Adara for letting us know. We plan to invest some time to improve the documentation soon, so this is timely and valuable input :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you! |
It's very easy to mistakenly pass a scope to
removeInterceptor
and not be aware it's wrong.First the difference between
interceptor
andscope
is not explained at all in the README, as far as I can tell.Second, after passing scope to
removeInterceptor
it actually returns true, even though it does not remove a single item.true
is returned unconditionally here: https://github.com/node-nock/nock/blob/11f1a25ee88b0328c92070e4749793902907a60d/lib/intercept.js#L219 no matter if there was a single match in the inner loop just above it, or not.It seems to me that passing a scope should just work, and be handled correctly (by removing all interceptor from the scope).
The text was updated successfully, but these errors were encountered: