-
Notifications
You must be signed in to change notification settings - Fork 30k
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: add test naming information to guide #10584
Conversation
A test must be a node script that exercises a specific functionality provided | ||
by node and checks that it behaves as expected. It should exit with code `0` on success, | ||
otherwise it will fail. A test will fail if: | ||
Most tests in Node.js core are JavaScript programs that exercise a specific |
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.
Nit: Can you say a functionality
? I feel like it should be a piece of functionality
or just functionality
.
otherwise it will fail. A test will fail if: | ||
Most tests in Node.js core are JavaScript programs that exercise a specific | ||
functionality provided by Node.js and check that it behaves as expected. Tests | ||
should exit with code `0` on success. A test will fail if: | ||
|
||
- It exits by setting `process.exitCode` to a non-zero number. | ||
- This is most often done by having an assertion throw an uncaught |
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.
more often or most often?
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.
Most often seems reasonable.
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 I'll just switch to the simpler usually
. :-D
more information about what is being tested. | ||
|
||
For example, a test for the `beforeExit` event on the `process` object might be | ||
named `test-process-beforeExit.js`. If the test specifically checked that arrow |
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.
As per #10581 (comment), we may have to discuss this further.
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide.
Nits handled, including camel-casing controversy. PTAL @thefourtheye. Perhaps @sam-github can look it over too. |
/ping @thefourtheye Does this look OK to you now? |
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: #10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Landed in eb0df4a |
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: nodejs#10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: nodejs#10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: nodejs#10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: nodejs#10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: #10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: #10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: #10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are named. This adds that information. There is also some copy-editing done on the first paragraph of the guide. PR-URL: #10584 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
The guide for writing tests is missing information on how tests are
named. This adds that information.
There is also some copy-editing done on the first paragraph of the
guide.
Checklist
Affected core subsystem(s)
doc test