| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Use common.mustCall() where appropriate. Remove some logic that is not required when common.mustCall() is used (incrementor/decrementor to make sure everything is called the same number of times).
Sorry, something went wrong.
| res.on('end', common.mustCall(() => { | ||
| console.error('Got full response.'); | ||
| assert.strictEqual(body, test_res_body, 'Response body doesn\'t match.'); | ||
| assert.strictEqual(body, test_res_body); |
There was a problem hiding this comment.
@Trott - is it that the removed error message is too awkward to be of any use, or is there a consensus / guideline to remove error messages from assertion statements?
Sorry, something went wrong.
There was a problem hiding this comment.
By including that assertion message, we suppress the printing of the contents of body and test_res_body when there is in AssertionError. Those values would seem to be useful for debugging. In contrast, the supplied message doesn't provide any useful information IMO.
An alternative would be to replace it with a template literal: `Response body doesn't match. Expected ${test_res_body} but received ${body}.` I prefer simply removing it, but I could go with that if it's deemed important to keep.
Sorry, something went wrong.
There was a problem hiding this comment.
thanks for the clarification!
Sorry, something went wrong.
|
|
||
| const server = http.createServer(handler); | ||
| server.on('checkContinue', function(req, res) { | ||
| const server = http.createServer(); |
There was a problem hiding this comment.
handler is no longer registered as a 'request' listener?
Sorry, something went wrong.
There was a problem hiding this comment.
Actually, given the description in the API docs for checkContinue it probably makes more sense to register a common.mustNotCall request listener.
Sorry, something went wrong.
Use common.mustCall() where appropriate. Remove some logic that is not required when common.mustCall() is used (incrementor/decrementor to make sure everything is called the same number of times). PR-URL: nodejs#19625 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use common.mustCall() where appropriate. Remove some logic that is not required when common.mustCall() is used (incrementor/decrementor to make sure everything is called the same number of times). PR-URL: #19625 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use common.mustCall() where appropriate. Remove some logic that is not required when common.mustCall() is used (incrementor/decrementor to make sure everything is called the same number of times). PR-URL: #19625 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Use common.mustCall() where appropriate. Remove some logic that is not
required when common.mustCall() is used (incrementor/decrementor to make
sure everything is called the same number of times).
Checklist