-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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 How to write a Node.js test
guide
#6984
Conversation
- It exits due to an uncaught exception. | ||
- It never exits. In this case, the test runner will terminate the test because it sets a maximum time limit. | ||
|
||
They can be added for multiple reasons: |
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: I’d prefer s/They/Tests/
because there’s no plural tests
before this in the text.
There’s a “test” missing in the commit message/PR title. Generally looking good, nice work! |
Oh, and I think linking this from the corresponding |
How to write a Node.js
guideHow to write a Node.js test
guide
@@ -0,0 +1,166 @@ | |||
# How to write a Node.js test |
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.
Would "How to write a test for the Node.js project" be better because I thought this is for how to write a test case in Node.js community, not the Node.js project in my first sight on this title. :-)
f5bd5fe
to
8259de3
Compare
LGTM and I still think linking this from the |
Oh! I forgot. Adding it... |
6b5c7a0
to
9fec0a5
Compare
Link added to |
structured (license boilerplate, common includes, etc.). | ||
`test/parallel/` directory. For guidance on how to write a test for the Node.js | ||
project, see this [guide](./doc/guides/writing_tests.md). Looking at other tests | ||
to see how they should be structured (license boilerplate, common includes, |
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.
There are only very few cases of explicit license notifications in the test code base (and in general) left, so I’d drop the mention here.
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.
Maybe dropping the whole parenthesis? The common includes info is already in the guide.
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.
@santigimeno Oh, sorry, didn’t see this was taken directly from the existing text. But yeah, +1 to dropping the whole parenthesis here.
LGTM with a comment |
Updated. Thanks! |
|
||
**Lines 3-4** | ||
|
||
``` |
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.
missing javascript
?
LGTM. There are definitely some more improvements that can happen in the CONTRIBUTING doc but it's probably best for that to happen in another PR. |
Added the missing |
The sentence about the location of the tests could be changed and then explained in some depth in the guide.
Agreed |
PR-URL: nodejs#6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
CI: https://ci.nodejs.org/job/node-test-pull-request/2862/. All green except unrelated failures in some ARM bots. Landing |
Landed in b83b363. Thanks! |
PR-URL: nodejs#6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
PR-URL: #6984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Checklist
Affected core subsystem(s)
doc, test
Description of change
Refs: nodejs/testing#30
/cc @nodejs/testing @nodejs/documentation