Throw error when leading slash is not present in path#1391
Conversation
rxco
approved these changes
Jan 22, 2019
Member
|
Hi! Thanks for this contribution :) New work is being done in the |
Contributor
Author
|
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.
gr2m
reviewed
Jan 24, 2019
gr2m
approved these changes
Jan 24, 2019
Member
gr2m
left a comment
There was a problem hiding this comment.
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.
paulmelnikow
approved these changes
Jan 25, 2019
Collaborator
|
🎉 This PR is included in version 11.0.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Member
|
@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. |
Member
|
works for me, we can edit the release notes |
Collaborator
|
🎉 This PR is included in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
gr2m
pushed a commit
that referenced
this pull request
Sep 4, 2019
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.
gr2m
pushed a commit
that referenced
this pull request
Sep 4, 2019
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.
gr2m
pushed a commit
that referenced
this pull request
Sep 5, 2019
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) |
uxmaster
added a commit
to uxmaster/nock
that referenced
this pull request
Jan 16, 2021
This artificial requirement was introduced by nock#1391.
uxmaster
added a commit
to uxmaster/nock
that referenced
this pull request
Jan 16, 2021
Fix bug introduced by nock#1391, _etc._
juninmd
pushed a commit
to juninmd/nock
that referenced
this pull request
Mar 21, 2026
Given nock#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.