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
feat(interceptor): duplicate query keys throw #1626
Conversation
Resolves nock#1623 BREAKING CHANGE: Providing a duplicate search parameter to the `query` method throws an error instead of ignoring subsequent values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great 👏
🎉 This PR is included in version 11.0.0-beta.26 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hmm, I was thinking about this a little differently. I was thinking we'd throw if there were multiple attempts to define the query, regardless of whether the keys duplicated each other. Meaning you would get an error if you did Or What do you think? |
Hmm sounds reasonable. Even if folks might want to merge query options conditionally, they can do that before passing it to |
I'm in favor of throwing an error if trying to set query filter data twice, but if we go that route I have two questions: Should we allow the user to explicitly unset query filtering? Second: we still need to handle duplicate query keys in some way. |
I think it's not necessary. Nock has so much API surface and if it comes to it they can
Right! Though since we were silently dropping duplicates before, I figured an explicit error was no worse…
Yes. That makes sense to me. 👍 URLSearchParams and literal query strings would be two ways of specifying queries with duplicated keys. |
Continuation of nock#1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
* feat(interceptor): duplicate query calls throw Continuation of #1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
🎉 This PR is included in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* feat(interceptor): duplicate query calls throw Continuation of #1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
* feat(interceptor): duplicate query calls throw Continuation of #1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
* feat(interceptor): duplicate query calls throw Continuation of #1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
Resolves #1623
BREAKING CHANGE: Providing a duplicate search parameter to the
query
method throws an error instead of ignoring subsequent values.