`removeInterceptor` with scope as an argument.
See original GitHub issueIt’s very easy to mistakenly pass a scope to removeInterceptor
and not be aware it’s wrong.
First the difference between interceptor
and scope
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).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
nock/nock: HTTP server mocking and expectations ... - GitHub
method returns Scope, not Interceptor, and so it is not a valid argument for nock.removeInterceptor . So if your method chain ends with...
Read more >Uses of Interface de.hybris.platform.servicelayer.interceptor ...
Methods in de.hybris.platform.servicelayer.internal.model.impl.wrapper that return types with arguments of type RemoveInterceptor ...
Read more >HTTP Server mocking for Node.js
removeInterceptor (options); function nock.scope.restore (); object nock.scope.emitter ... if( arguments.length === 2 ) { nockedFn = options; ...
Read more >Unable to remove interceptors using nock - Stack Overflow
I am using nock and I'm trying to remove interceptors for certain hostname. I have tried using: nock.removeInterceptor({ hostname: 'somehostname ...
Read more >nock - Devpost
You can specify the request body to be matched as the second argument to the get , post , put or delete specifications...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 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!