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
Fix test: "get with reply callback returning default statusCode without body" #1222
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions. |
- Add several tests for several missing edge cases. - Rewrite the test for #1222 so it reflects what I believe is the desired behavior. - Indicate one test where behavior is supported today but seems unnecessary. - Add one skipped test for a likely bug.
I've been puzzling over this issue in relation to #1203 (comment) and think 🤔I have it sorted out! In the test run referenced in the linked comment, the failing test was "get with reply callback returning default statusCode without body". It tested that This was not the same test as the one added in PR #1203. In that PR the new test was "reply should send correct statusCode with array-notation and without body" and tested that It did not make assertions on the body, though the body behavior was unchanged: it sent a JSON-stringified array It's clear these tests could not have passed at the same time. It's not clear why the PR branch didn't reflect this. (Out of date with master? Flaky test suite? The test suite is more reliable now, in part because of #1465. And also #1077, though that was about fixing false positives rather than false negatives.) While I agree with #1170, that That behavior is in the process of being changed in #1520, which, if no objections, will cause The documentation is ambiguous, and you could argue this is a bug fix. Though, people may be depending on this have-your-cake-and-eat-it-too behavior that nock has had since 10.0.0, so we may as well label it a breaking change, which will ship (soon! see #1516) as part of v11. /cc @mastermatt |
Put another way, .reply(() => [417]) is currently interpreted as .reply(() => [417, [417]]) It should instead be interpreted as .reply(() => [417, '']) |
🎉 This issue has been resolved in version 11.0.0-beta.15 🎉 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 📦🚀 |
- Add several tests for several missing edge cases. - Rewrite the test for #1222 so it reflects what I believe is the desired behavior. - Indicate one test where behavior is supported today but seems unnecessary. - Add one skipped test for a likely bug.
- Add several tests for several missing edge cases. - Rewrite the test for #1222 so it reflects what I believe is the desired behavior. - Indicate one test where behavior is supported today but seems unnecessary. - Add one skipped test for a likely bug.
- Add several tests for several missing edge cases. - Rewrite the test for #1222 so it reflects what I believe is the desired behavior. - Indicate one test where behavior is supported today but seems unnecessary. - Add one skipped test for a likely bug.
This is a follow up for #1203 (comment). I’ll disable the test for the time being in #1145
The text was updated successfully, but these errors were encountered: