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
Add query strings to .pendingMocks()
#2234
Comments
I wonder why though? Can you elaborate? |
I don't know. A lot of nock comes from years of if-y documented incremental changes. If I were to guess, I think its design was a judgement call how to represent pending interceptors as strings. One could argue that it should only rerun the host vs more and more eg. path, query, etc. Personally I've never been a fan of it returning strings. Intuitively, I thought it should return Interceptors directly. 🤷 |
same :) I'll dig more into nock's code next week, maybe I'll find out why the method behaves the way it currently does |
Are you keeping track of the interceptors separately? I don't think there is a way to access all the interceptors using nock is there?
|
Context
Currently it is easy to miss that an interceptor isn't matching due to mismatching query strings.
Alternatives
This may be a breaking change if users are expecting specific messages so may not be ideal. An alternative would be to expose a new function such as
pendingInterceptors()
which would contain a lot more information that could be useful.Has the feature been requested before?
I couldn't find any but there is another user who was confused by this: #2182
If the feature request is accepted, would you be willing to submit a PR?
Yes
The text was updated successfully, but these errors were encountered: