-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
update test/parallel/test-fs-read-stream-inherit.js to use ES6 variable declarations and assert.strictEqual #9894
update test/parallel/test-fs-read-stream-inherit.js to use ES6 variable declarations and assert.strictEqual #9894
Conversation
converts all instances of 'var' to const / let
converts instances of assert.equal to assert.strictEqual
@@ -49,18 +49,18 @@ file.on('end', function(chunk) { | |||
file.on('close', function() { | |||
callbacks.close++; | |||
|
|||
//assert.equal(fs.readFileSync(fn), fileContent); | |||
//assert.strictEqual(fs.readFileSync(fn), fileContent); |
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.
Why not just remove this?
|
||
file.on('open', function(fd) { | ||
file.length = 0; | ||
callbacks.open++; | ||
assert.equal('number', typeof fd); | ||
assert.strictEqual('number', typeof 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.
Nit: can you please swap the arguments here and throughout the rest of the file? The function signature is assert.strictEqual(actual, expected[, message]);
Removes an assert that has been commented out.
Fixes the parameter order to some calls of assert.strictEqual to be consistent with documentation and the rest of the file.
console.error('ok'); | ||
}); | ||
|
||
var file4 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1, | ||
const file4 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1, | ||
start: 1, end: 2})); |
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.
Nit: would you mind to align start
with rangeFile
?
}); | ||
|
||
var file5 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1, | ||
const file5 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1, | ||
start: 1})); |
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.
Same here.
}); | ||
|
||
// https://github.com/joyent/node/issues/2320 | ||
var file6 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1.23, | ||
const file6 = fs.createReadStream(rangeFile, Object.create({bufferSize: 1.23, | ||
start: 1})); |
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.
Ditto, there are also a couple more below.
Fixes spacing that become improperly alligned after changing var declarations to const.
@jmdarling awesome, thank you! |
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.
LGTM! thank you for the PR and for participating in the code-and-learn!
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in e00c4bf. thank you! |
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: nodejs#9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: nodejs#9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
Updates test/parallel/test-fs-read-stream-inherit.js by: