-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: note that tests should include a description #9415
Conversation
15 port: server.address().port, | ||
16 headers: {'Test': 'Düsseldorf'} | ||
17 }, common.mustCall((res) => { | ||
18 assert.equal(res.statusCode, 200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which test is this? We should recommend assert.strictEqual
I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thefourtheye Done
8a03e45
to
dbcdaaf
Compare
d0655d8
to
506756a
Compare
7 const http = require('http'); | ||
8 const assert = require('assert'); | ||
9 | ||
10 const server = http.createServer(common.mustCall((req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still align the code part perfectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I agree with @thefourtheye that if we can align the code (probably just add an extra space at the start of lines 1-9?), that would be preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I don't think we should make this a hard requirement.
506756a
to
21a52b0
Compare
@Trott @thefourtheye This should be fixed @cjihrig Agreed. |
Update the Writing Tests guide to specify that tests should include a brief description of what they are designed to test. PR-URL: nodejs#9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>oc
PR-URL: nodejs#9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
21a52b0
to
a99b441
Compare
Merged in: 3e6cc60...a99b441 |
Update the Writing Tests guide to specify that tests should include a brief description of what they are designed to test. PR-URL: #9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>oc
PR-URL: #9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Update the Writing Tests guide to specify that tests should include a brief description of what they are designed to test. PR-URL: #9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>oc
PR-URL: #9415 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Checklist
Affected core subsystem(s)
doc, test
Description of change
When debugging tests it is a huge help to have some basic information about what the purpose of the test actually is, especially as the person who originally wrote the test may no longer be active. This updates the Writing Tests guide to require that.
It's unlikely that anyone is going to have the time or the inclination to go through every test adding documentation, but specifying that we'd like some would be a good start.
Nits/bikeshedding/flat-out disagreement welcome!
cc/ @nodejs/testing