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.
Can you drop the Skipped: part.
There was a problem hiding this comment.
Might actually be worthwhile to lint for Skipped: in strings in tests come to think of it.
There was a problem hiding this comment.
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.
Keep common.skip(). There is just no need to say you're skipping in skip().
There was a problem hiding this comment.
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.
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
indexOftoincludesfor clarity.assert.strictEqualfromassert.equalvartoconstcommon.refreshTmpDir