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

Tests: Refactored to es6 #9700

Closed
wants to merge 6 commits into from
Closed

Conversation

itsmed
Copy link
Contributor

@itsmed itsmed commented Nov 19, 2016

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)

Tests

Description of change

Changed var to const, assert.equal to assert.strictEqual. Changed anonymous functions to use arrow functions.

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 19, 2016
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Nov 19, 2016
@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2016

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

assert.ifError(error);

var read = fs.createReadStream(emptyFile, { 'fd': fd });
const read = fs.createReadStream(emptyFile, { 'fd': fd });
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change { 'fd': fd } to just { fd }.


read.once('data', function() {
read.once('data', () => {
throw new Error('data event should not emit');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you replace the throws with common.fail().

@itsmed
Copy link
Contributor Author

itsmed commented Nov 20, 2016

Ok, thanks. Changes made.

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

Almost there...

});

read.once('end', common.mustCall(function endEvent1() {}));
});

fs.open(emptyFile, 'r', function(error, fd) {
fs.open(emptyFile, 'r', (error, fd) => {
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()


fs.open(emptyFile, 'r', function(error, fd) {
fs.open(emptyFile, 'r', (error, fd) => {
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 should be wrapped in a common.mustCall()

@itsmed
Copy link
Contributor Author

itsmed commented Dec 19, 2016

Ok I think I've got it this time!

@italoacasas
Copy link
Contributor

italoacasas commented Jan 16, 2017

ping @jasnell

@itsmed can you rebase please

itsmed and others added 6 commits January 18, 2017 11:59
Changed var to const, assert.equal to assert.strictEqual
Replaced anonymous functions with arrow functions.
Replaced throw new Error with common.fail.
Replaced anonymous functions with arrow functions.
Replaced throw new Error with common.fail.
Changed var to const, assert.equal to assert.strictEqual
Replaced anonymous functions with arrow functions.
Replaced throw new Error with common.fail.
@itsmed
Copy link
Contributor Author

itsmed commented Jan 18, 2017

@italoacasas rebase done.

@italoacasas
Copy link
Contributor

italoacasas commented Jan 18, 2017

@joyeecheung
Copy link
Member

The previous CI job is gone. New CI: https://ci.nodejs.org/job/node-test-pull-request/6230/

@italoacasas italoacasas added v7.x and removed v7.x labels Feb 6, 2017
@jasnell jasnell added the stalled Issues and PRs that are stalled. label Mar 24, 2017
@fhinkel
Copy link
Member

fhinkel commented Mar 26, 2017

@itsmed thanks for putting this together. Looks like we're missing a ) in line 61. I went ahead and fixed that in the PR, also squashed the commits into one. Landed in d13bd4a

@fhinkel fhinkel closed this Mar 26, 2017
fhinkel pushed a commit that referenced this pull request Mar 26, 2017
Replace anonymous functions with arrow functions.
Replace throw new Error with common.fail.

PR-URL: #9700
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
Replace anonymous functions with arrow functions.
Replace throw new Error with common.fail.

PR-URL: #9700
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 28, 2017
@italoacasas italoacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
Replace anonymous functions with arrow functions.
Replace throw new Error with common.fail.

PR-URL: #9700
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
Replace anonymous functions with arrow functions.
Replace throw new Error with common.fail.

PR-URL: #9700
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
Replace anonymous functions with arrow functions.
Replace throw new Error with common.fail.

PR-URL: nodejs/node#9700
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
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 the fs subsystem / file system. stalled Issues and PRs that are stalled. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants