Skip to content
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

addin test for _stream.writable finished state #8791

Closed
wants to merge 1 commit into from
Closed

addin test for _stream.writable finished state #8791

wants to merge 1 commit into from

Conversation

italoacasas
Copy link
Contributor

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change
  • Adding tests for stream._writableState.finished

Issue related: #8686

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Sep 26, 2016
@mscdex mscdex added the stream Issues and PRs related to the stream subsystem. label Sep 26, 2016
@mcollina mcollina self-assigned this Sep 26, 2016

assert.strictEqual(writable._writableState.finished, false);

writable.end('testing finished state', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback here should be wrapped in a common.mustCall() in order to validate that it really does get called.


writable._write = (chunk, encoding, cb) => {
cb();
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add an assert also here that finished is false?

@mcollina
Copy link
Member

Good job! cc @nodejs/streams

@mcollina
Copy link
Member

mcollina commented Sep 29, 2016

Can you please update the commit message to follow our standards?

@jasnell
Copy link
Member

jasnell commented Sep 30, 2016

The commit style guidelines are detailed here: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit :-)

@rvagg rvagg force-pushed the master branch 2 times, most recently from c133999 to 83c7a88 Compare October 18, 2016 17:02
@italoacasas
Copy link
Contributor Author

@mcollina ping

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
Copy link
Member

@mcollina
Copy link
Member

Failures unrelated. This is good to go, I'm planning on merging tomorrow or Friday, if no one else has objections.

const writable = new stream.Writable();

writable._write = (chunk, encoding, cb) => {
// the state finished should start in false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you capitalize and punctuate the comment please.

@mcollina
Copy link
Member

mcollina commented Oct 28, 2016

Merged in f12338d

@mcollina mcollina closed this Oct 28, 2016
mcollina pushed a commit that referenced this pull request Oct 28, 2016
Add a test for _writableState.finished.

PR-URL: #8791
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
evanlucas pushed a commit that referenced this pull request Nov 3, 2016
Add a test for _writableState.finished.

PR-URL: #8791
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Add a test for _writableState.finished.

PR-URL: #8791
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Add a test for _writableState.finished.

PR-URL: #8791
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 19, 2016
Add a test for _writableState.finished.

PR-URL: #8791
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
This was referenced Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants