Skip to content

test: improve the code in test-fs-read-stream - #10556

Closed
edsadr wants to merge 1 commit into
nodejs:masterfrom
edsadr:fs-read-stream
Closed

test: improve the code in test-fs-read-stream#10556
edsadr wants to merge 1 commit into
nodejs:masterfrom
edsadr:fs-read-stream

Conversation

@edsadr

@edsadr edsadr commented Dec 31, 2016

Copy link
Copy Markdown
Contributor
  • use const and let instead of var
  • use common.mustCall to control function execution
  • use assert.strictEqual instead of assert.equal
  • use arrow functions
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to Node.js core tests and test infrastructure. lts-watch-v6.x labels Dec 31, 2016
@mscdex mscdex added the fs Issues and PRs related to file-system APIs and the fs module. label Dec 31, 2016
Comment thread test/parallel/test-fs-read-stream-fd.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the common.mustCall() should be removed since there could be more than one 'data' event and we're already verifying the output on process exit anyway.

Comment thread test/parallel/test-fs-read-stream-fd.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While we're in here editing the file, can you please remove fs.unlinkSync(file);? (There's no need for tests to clean up the temp dir on exit as all tests that use the temp dir should refresh it before using it.)

@edsadr

edsadr commented Jan 2, 2017

Copy link
Copy Markdown
Contributor Author

@mscdex @Trott ... implemented both suggestions...

@mscdex

mscdex commented Jan 2, 2017

Copy link
Copy Markdown
Contributor

LGTM

@Trott Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if CI is ✅

@Trott

Trott commented Jan 2, 2017

Copy link
Copy Markdown
Member

@evanlucas evanlucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
@edsadr

edsadr commented Jan 3, 2017

Copy link
Copy Markdown
Contributor Author

solved the conflicts after ff1efa6 , please set the CI again

@italoacasas

Copy link
Copy Markdown

@italoacasas

Copy link
Copy Markdown

Landed 7a46b99

@italoacasas italoacasas closed this Jan 3, 2017
italoacasas pushed a commit that referenced this pull request Jan 3, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: #10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: nodejs#10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 19, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: nodejs#10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
targos pushed a commit that referenced this pull request Jan 28, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: #10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: nodejs#10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: nodejs#10556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to file-system APIs and the fs module. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants