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

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-botnodejs-github-bot added test Issues and PRs related to the tests. lts-watch-v6.x labels Dec 31, 2016
@mscdexmscdex added the fs Issues and PRs related to the fs subsystem / file system. label Dec 31, 2016

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.

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

Copy link
Copy Markdown
ContributorAuthor

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

@mscdex

Copy link
Copy Markdown
Contributor

LGTM

@TrottTrott 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

@evanlucasevanlucas 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

Copy link
Copy Markdown
ContributorAuthor

solved the conflicts after ff1efa6 , please set the CI again

@italoacasas

Copy link
Copy Markdown

@italoacasas

Copy link
Copy Markdown

Landed 7a46b99

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>
@italoacasasitaloacasas 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fsIssues and PRs related to the fs subsystem / file system.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@edsadr@mscdex@Trott@italoacasas@evanlucas@MylesBorins@nodejs-github-bot