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
allowUnmocked option doesn't work properly for specified paths #1867
Labels
Comments
From a first look on trying to recreate this, it seem to only be broken when the verb method is provided a callback. Passing a string or regex works as expected. |
mastermatt
added a commit
to mastermatt/nock
that referenced
this issue
Feb 7, 2020
When an Interceptor was created with a comparator for the path, the `matchOrigin` function was comparing the string equivalent of the function instead of evaluating it. I'm not a fan of the fact that the function `matchOrigin` is comparing the pathname, but that's a refactor for another day. Fixes: nock#1867
mastermatt
added a commit
to mastermatt/nock
that referenced
this issue
Feb 8, 2020
When an Interceptor was created with a comparator for the path, the `matchOrigin` function was comparing the string equivalent of the function instead of evaluating it. I'm not a fan of the fact that the function `matchOrigin` is comparing the pathname, but that's a refactor for another day. Fixes: nock#1867
mastermatt
added a commit
that referenced
this issue
Feb 10, 2020
* fix: allowMocked when using a callback for the path When an Interceptor was created with a comparator for the path, the `matchOrigin` function was comparing the string equivalent of the function instead of evaluating it. I'm not a fan of the fact that the function `matchOrigin` is comparing the pathname, but that's a refactor for another day. Fixes: #1867
🎉 This issue has been resolved in version 11.8.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the expected behavior?
Specified path predicate + allowUnmocked doesn't return mocked response.
What is the actual behavior?
Specified path predicate + allowUnmocked should return mocked response.
Possible solution
How to reproduce the issue
Runkit: Example link
Having problem producing a test case? Try and ask the community for help. If the test case cannot be reproduced, the Nock community might not be able to help you.
Does the bug have a test case?
Versions
The text was updated successfully, but these errors were encountered: