Skip to content
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

Merged
merged 2 commits into from
Nov 5, 2016

Conversation

gibfahn
Copy link
Member

@gibfahn gibfahn commented Nov 2, 2016

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
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

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Nov 2, 2016
15 port: server.address().port,
16 headers: {'Test': 'Düsseldorf'}
17 }, common.mustCall((res) => {
18 assert.equal(res.statusCode, 200);
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 const http = require('http');
8 const assert = require('assert');
9
10 const server = http.createServer(common.mustCall((req, res) => {
Copy link
Contributor

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.

@mscdex mscdex added the test Issues and PRs related to the tests. label Nov 2, 2016
Copy link
Member

@Trott Trott left a 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.

Copy link
Contributor

@cjihrig cjihrig left a 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.

@gibfahn
Copy link
Member Author

gibfahn commented Nov 3, 2016

@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>
@gibfahn gibfahn merged commit a99b441 into nodejs:master Nov 5, 2016
@gibfahn
Copy link
Member Author

gibfahn commented Nov 5, 2016

Merged in: 3e6cc60...a99b441

evanlucas pushed a commit that referenced this pull request Nov 7, 2016
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
evanlucas pushed a commit that referenced this pull request Nov 7, 2016
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>
MylesBorins pushed a commit that referenced this pull request Nov 22, 2016
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
MylesBorins pushed a commit that referenced this pull request Nov 22, 2016
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>
@MylesBorins MylesBorins mentioned this pull request Nov 22, 2016
@gibfahn gibfahn deleted the pr-document-tests branch December 16, 2016 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants