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 calls throw #1630
Conversation
Continuation of nock#1626 BREAKING CHANGE: Attempting to call `Interceptor.query` twice throws an error.
Going down the route of properly supporting duplicate keys (which I would consider a bug fix, not a feature) gets into the weeds of the issue that we still use |
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.
Nice one!
tests/test_query.js
Outdated
@@ -122,16 +122,27 @@ test('query() accepts URLSearchParams as input', async t => { | |||
}) | |||
|
|||
test('query() throws for duplicate keys', async t => { |
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.
test('query() throws for duplicate keys', async t => { | |
test('query() throws if query params have already been defined', async t => { |
tests/test_query.js
Outdated
) | ||
}) | ||
|
||
test('query() throws for invalid arguments', async t => { |
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.
test('query() throws for invalid arguments', async t => { | |
test('query() throws for invalid arguments', t => { |
Will also need a t.end()
.
@@ -55,7 +55,6 @@ test('Nock with allowUnmocked, url match and query false', async t => { | |||
|
|||
nock(`${url}`, { allowUnmocked: true }) | |||
.get('/') | |||
.query(false) |
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.
Ah, we're removing support for this undocumented feature, correct? Could you update the test title to remove "query false"?
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 test just seems to be a duplicate of the test above now, so I'm going to remove it completely.
🎉 This PR is included in version 11.0.0-beta.27 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 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.
Continuation of #1626
BREAKING CHANGE: Attempting to call
Interceptor.query
twice throws an error.