-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test:replace indexOf, assert.equal, add mustCall #8766
Conversation
@@ -40,9 +40,9 @@ fs.symlink(linkData, linkPath, function(err) { | |||
|
|||
fs.readlink(linkPath, common.mustCall(function(err, destination) { | |||
if (err) throw err; |
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.
All of the if (err) throw err;
can be replaced by assert.ifError(err);
.
LGTM (either with or without the |
LGTM with the |
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
replace indexOf with includes replace assert.equal with assert.strictEqual add common.mustCall replace throw error with assert.ifError PR-URL: nodejs#8766 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Landed in 8cd2306 |
Just a minor nit, but I noticed a missing space between subsystem name and first part of the actual message. |
replace indexOf with includes replace assert.equal with assert.strictEqual add common.mustCall replace throw error with assert.ifError PR-URL: #8766 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
replace indexOf with includes replace assert.equal with assert.strictEqual add common.mustCall replace throw error with assert.ifError PR-URL: #8766 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
In test/parallel/test-fs-symlink.js:
Line 15: the use of o.indexOf() can be replaced with a usage of o.includes() which will make it more clear.
Line 43: the use of assert.equal() can be assert.strictEqual() instead
Line 28: the callback should be wrapped in common.mustCall() like in other instances of callbacks later in the file.