-
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: document and test that methods return this #13531
Conversation
Looks like the CI had some issues with these changes. |
9efc259
to
a8e5947
Compare
getConnections() doesn't return this either, I forgot and left in the test that proved it :-(. see #13553 I think that's the last of them. |
doc/api/net.md
Outdated
@@ -673,6 +693,8 @@ The numeric representation of the local port. For example, | |||
Pauses the reading of data. That is, [`'data'`][] events will not be emitted. | |||
Useful to throttle back an upload. | |||
|
|||
Returns `socket`. |
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 please add this also for socket.resume()
?
I think makes sense to use 2 commits. One for the doc changes and one for the tests. |
I count 11 (possibly 12) doc changes and only 5 test changes... sorry for not digging deeper but are the other cases covered (but where just undocumented)? |
I'll audit again, but I believe the listen paths are well tested, our code is full of |
Unrelated freebsd test failure, is that test flaky, @nodejs/platform-freebsd ? |
Known: #13597 |
@@ -137,6 +137,8 @@ The optional `callback` will be called once the `'close'` event occurs. Unlike | |||
that event, it will be called with an Error as its only argument if the server | |||
was not open when it was closed. | |||
|
|||
Returns `server`. |
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.
In various other parts of the docs (randomly selected example: https://nodejs.org/dist/latest-v8.x/docs/api/crypto.html#crypto_certificate_exportchallenge_spkac) the Returns
is listed as a bullet point along with the expected arguments. For consistency, this should do the same.
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 existing docs to be like that, PTAL.
a8e5947
to
1c3d232
Compare
@jasnell I notice that streams has a different doc convention:
I'm not sure which is the convention we are heading towards, is this PR converging or diverging from where we want to go? |
Sounds like another "do whatever in this PR, then raise a new PR unifying them and documenting it in the STYLE_GUIDE" question. |
I'm OK to just get it right here, and agree, the STYLE_GUIDE should be updated. |
1c3d232
to
61982ce
Compare
Also, add tests to ensure they will always return this, and to confirm they return this when these doc changes are back-ported to earlier release lines. PR-URL: nodejs#13553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
61982ce
to
44a8fa6
Compare
Also, add tests to ensure they will always return this, and to confirm they return this when these doc changes are back-ported to earlier release lines. PR-URL: nodejs#13531 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Also, add tests to ensure they will always return this, and to confirm they return this when these doc changes are back-ported to earlier release lines. PR-URL: #13531 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Also, add tests to ensure they will always return this, and to confirm they return this when these doc changes are back-ported to earlier release lines. PR-URL: #13531 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This does not land cleanly in LTS. Please feel free to manually backport. Please also feel free to replace the backport request label with do-not-land if it shouldn't land |
I've ended up backporting this without the doc changes (as that was the conflict). Please feel free to manually backport that change in a new PR landed in 2fb1381 |
Backport of the documentation from nodejs#13531 that did not land in 2fb1381. PR-URL: nodejs#13553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Also, add tests to ensure they will always return this, and to confirm
they return this when these doc changes are back-ported to earlier
release lines.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc,net