-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
got() automatic retries makes for confusing failures in Nock tests #1523
Labels
Comments
paulmelnikow
added a commit
that referenced
this issue
May 1, 2019
paulmelnikow
added a commit
that referenced
this issue
May 1, 2019
gr2m
pushed a commit
that referenced
this issue
May 2, 2019
🎉 This issue has been resolved in version 11.0.0-beta.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
gr2m
pushed a commit
that referenced
this issue
Sep 4, 2019
gr2m
pushed a commit
that referenced
this issue
Sep 4, 2019
gr2m
pushed a commit
that referenced
this issue
Sep 5, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I mentioned at #1515 (comment), Got automatically retries failed requests twice.
That means if you have a test which mocks a 4xx or 5xx response, got will immediately reissue it.
At that point, the mock will have been consumed. The test will error out with
Nock: No match for request
.Adding
{ retry: 0 }
to thegot
calls will disable this behavior, and will make the tests behave less confusingly.As I also mentioned in that thread:
We should use
got.extend()
to set defaults that turn off this behavior.The text was updated successfully, but these errors were encountered: