-
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
test: cleanup test require symlink #8305
Conversation
* Changed `==` to `includes` for clarity. * Switched to `assert.strictEqual` from `assert.equal` * Changed some `var` to `const` * Test cleanup with `common.refreshTmpDir`
Changes LGTM if CI is happy. There's an additional potential improvement around avoiding writing to the fixture directory. But that can be a separate |
CI is green. |
if (err || o.indexOf('SeCreateSymbolicLinkPrivilege') == -1) { | ||
console.log('Skipped: insufficient privileges'); | ||
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) { | ||
common.skip('Skipped: insufficient privileges'); |
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 drop the Skipped:
part.
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.
Might actually be worthwhile to lint for Skipped:
in strings in tests come to think of it.
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.
Sure I can change it. Do you want me to revert it back to console.log or just remove this line?
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.
Keep common.skip()
. There is just no need to say you're skipping in skip()
.
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.
In other words, change this:
common.skip('Skipping: insufficient privileges');
to something like this:
common.skip('insufficient privileges');
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.
Whoops sorry misread the initial comment by @cjihrig. Fixed now
LGTM with a comment. |
LGTM |
2 similar comments
LGTM |
LGTM |
* Changed `==` to `includes` for clarity. * Switched to `assert.strictEqual` from `assert.equal` * Changed some `var` to `const` * Test cleanup with `common.refreshTmpDir` PR-URL: #8305 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in eca74a9! Thank you! |
* Changed `==` to `includes` for clarity. * Switched to `assert.strictEqual` from `assert.equal` * Changed some `var` to `const` * Test cleanup with `common.refreshTmpDir` PR-URL: nodejs#8305 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* Changed `==` to `includes` for clarity. * Switched to `assert.strictEqual` from `assert.equal` * Changed some `var` to `const` * Test cleanup with `common.refreshTmpDir` PR-URL: #8305 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
indexOf
toincludes
for clarity.assert.strictEqual
fromassert.equal
var
toconst
common.refreshTmpDir