-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Tests: Refactored to es6 #9700
Conversation
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.
Can you update the commit message according to https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit.
assert.ifError(error); | ||
|
||
var read = fs.createReadStream(emptyFile, { 'fd': fd }); | ||
const read = fs.createReadStream(emptyFile, { 'fd': fd }); |
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.
Can you change { 'fd': fd }
to just { fd }
.
|
||
read.once('data', function() { | ||
read.once('data', () => { | ||
throw new Error('data event should not emit'); |
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.
Can you replace the throw
s with common.fail()
.
Ok, thanks. Changes made. |
de2cb73
to
e20d3c7
Compare
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.
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.
Almost there...
}); | ||
|
||
read.once('end', common.mustCall(function endEvent1() {})); | ||
}); | ||
|
||
fs.open(emptyFile, 'r', function(error, fd) { | ||
fs.open(emptyFile, 'r', (error, fd) => { |
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.
The callback here should be wrapped in a common.mustCall()
|
||
fs.open(emptyFile, 'r', function(error, fd) { | ||
fs.open(emptyFile, 'r', (error, fd) => { |
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.
The callback should be wrapped in a common.mustCall()
e20d3c7
to
0bfa619
Compare
Ok I think I've got it this time! |
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.
0bfa619
to
6b3e7ef
Compare
@italoacasas rebase done. |
The previous CI job is gone. New CI: https://ci.nodejs.org/job/node-test-pull-request/6230/ |
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]>
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]>
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]>
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]>
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]>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Tests
Description of change
Changed var to const, assert.equal to assert.strictEqual. Changed anonymous functions to use arrow functions.