Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
Streams: add test for _readableState.readingMore | #8685#9868
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
chmln commented Dec 1, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
italoacasas commented Dec 1, 2016
cc: @mcollina |
| @@ -0,0 +1,31 @@ | |||
| 'use strict' | |||
| const Readable = require('stream').Readable, | |||
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.
Please require ../common.js, as done in other test files.
| @@ -0,0 +1,31 @@ | |||
| 'use strict' | |||
| const Readable = require('stream').Readable, | |||
| assert = require('assert'); | |||
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.
Please use a new const statement on each line (drop the comma separated declarations).
| assert.strictEqual(readable._readableState.readingMore, false); | ||
| readable.on('data', data =>{ | ||
| // still in a flowing state, try to read more |
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.
Please capitalize and punctuate comments.
| // false initially | ||
| assert.strictEqual(readable._readableState.readingMore, false); | ||
| readable.on('data', data =>{ |
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.
Since there are assertions inside of this callback, can you wrap it in common.mustCall().
| assert.strictEqual(readable._readableState.readingMore, true); | ||
| }); | ||
| readable.on('end', () =>{ |
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.
Same comment about common.mustCall() here.
| }); | ||
| readable.push("abc"); |
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.
Please use single quotes for strings.
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.
@cjihrig Thank you for the guidance 👍
mcollina commented Dec 1, 2016
We need to have an equivalent for |
chmln commented Dec 1, 2016
Absolutely. |
mcollina commented Dec 7, 2016
@chmln keep it coming :). The current test looks good, I'll wait for the one on the |
mcollina commented Dec 9, 2016
mcollina left a comment
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
italoacasas commented Dec 11, 2016
Landed 8621ccc Thanks for the contribution. |
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
PR-URL: #9868 Refs: #8685 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
#8685
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
stream
Description of change
Test cases for
stream.Readable._readableState.readingandreadingMoreproperties are tested on initialization, underdata,readable, andendevents.