-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
Throw error when leading slash is not present in path #1391
Conversation
Hi! Thanks for this contribution :) New work is being done in the |
Rebased onto |
Previously, whenever you intercept a path with no leading slash nock will not resolve the URL correctly. This fixes the issue by adding a leading slash if required while creating an Interceptor. Check #1259 to know more.
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 looks great now! Thanks for bearing with us Kevin 👍
Given #1391 (comment), we decided to make nock raise an error whenever the user forgets to add a leading slash into the intercepted path, instead of adding it itself.
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 PR is included in version 11.0.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@gr2m I noticed this is listed as a big fix but I think it might be better to call it out as a new feature when 11 is released. |
works for me, we can edit the release notes |
🎉 This PR is included in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Given #1391 (comment), we decided to make nock raise an error whenever the user forgets to add a leading slash into the intercepted path, instead of adding it itself.
Given #1391 (comment), we decided to make nock raise an error whenever the user forgets to add a leading slash into the intercepted path, instead of adding it itself.
Given #1391 (comment), we decided to make nock raise an error whenever the user forgets to add a leading slash into the intercepted path, instead of adding it itself.
Nock should not throw when the path equals '', to enable testing paths without trailing slash, see #2042 (comment) |
This artificial requirement was introduced by nock#1391.
Fix bug introduced by nock#1391, _etc._
Previously, whenever you intercept a path with no leading slash nock will not resolve the URL correctly. This fixes the issue by adding a leading slash if required while creating anInterceptor
.Given #1391 (comment), we decided to make nock raise an error whenever the user forgets to add a leading slash into the intercepted path, instead of adding it itself.
Fixes #1259.