-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
update test/parallel/test-fs-read-stream-inherit.js to use ES6 variable declarations and assert.strictEqual #9894
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in e00c4bf. thank you! |
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: nodejs#9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: nodejs#9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* convert assert.equal to assert.strictEqual * convert var to const/let PR-URL: #9894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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: