-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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: Docs for the common module API in tests #8840
Conversation
Alphabetized list of methods and properties for the common.js module. Add table of contents to the top of the readme.
# Tests | ||
# Table of Contents | ||
* [test directories](#tests) | ||
* [common module API](#commonjs) |
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 the link text should be consistent with the corresponding title?
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.
Sounds good. I'll change the headers of each section to match the link text 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.
Can you capitalize 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.
I changed this to read 'Common module API'.
I think all links should be collected at the bottom of the document and referenced appropriately like is done with documentation in |
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.
A lot of these can use some expansion, rewording, etc., but as a first pass to get everything documented minimally, this LGTM.
### tmpDirName | ||
* return [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | ||
|
||
Name of the tmpDir, currently 'tmp' |
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.
It's not always tmp
. It is initialized to that, but later on in common.js
, it gets altered if the TEST_THREAD_ID
environment variable is defined. I would just say: "Name of the temp directory used by tests."
Nit: period at the end for consistency
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.
Cool. I'll reword this in the next couple of days.
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: Add a newline at the end of the file. Upcoming linting on .md files will require it. (The file passes all the other lint rules currently configured in .remarkrc
.)
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.
Done. Also, I've never seen remark. That's pretty cool
LGTM with nit about link text. Thank you for doing this!!! |
@nodejs/testing |
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 this is very useful, but we should probably try to format more like the API docs for consistency.
# Tests | ||
# Table of Contents | ||
* [test directories](#tests) | ||
* [common module API](#commonjs) |
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.
Can you capitalize here?
@@ -126,3 +130,243 @@ and `setInterval`). | |||
| Runs on CI | | |||
|:----------:| | |||
| No | | |||
|
|||
|
|||
## Common.js |
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.
Can you lowercase this?
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.
yep
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 changed this to read 'Common module API' to match the wording used in the table of contents. Is that cool?
|
||
|
||
## Common.js | ||
|
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.
A sentence or two here about what common.js is would be nice.
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.
Will do
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.
Let me know what you think of those couple of sentences.
## Common.js | ||
|
||
### allowGlobals(...whitelist) | ||
* `whitelist` [<Array>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) Array of Globals |
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.
We don't typically use angle brackets around the data types do we?
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.
For this I used similar formatting to https://nodejs.org/dist/latest-v6.x/docs/api/fs.html#fs_event_change
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
Update some text and new line at end of README
@cjihrig Have your comments been addressed? |
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.
Yea, this is a good start.
Great idea. :D |
Alphabetized list of methods and properties for the common.js module. Add table of contents to the top of the readme. PR-URL: nodejs#8840 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in 2cfd7fd |
Alphabetized list of methods and properties for the common.js module. Add table of contents to the top of the readme. PR-URL: #8840 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Alphabetized list of methods and properties for the common.js module. Add table of contents to the top of the readme. PR-URL: #8840 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
Affected core subsystem(s)
doc
Description of change
Alphabetized list of methods and properties for the common.js
module in test. Add table of contents with link to API doc to the top
of the readme.