test: replace fs.accessSync with common.fileExists#17446
test: replace fs.accessSync with common.fileExists#17446Leko wants to merge 2 commits intonodejs:masterfrom Leko:replace_fs-accessSync_with_common-fileExists
Conversation
test/parallel/test-npm-install.js
Outdated
| assert.doesNotThrow(function() { | ||
| fs.accessSync(`${installDir}/node_modules/package-name`); | ||
| }); | ||
| assert(common.fileExists(`${installDir}/node_modules/package-name`)); |
There was a problem hiding this comment.
fs.existsSync() would be a better choice.
There was a problem hiding this comment.
This raises the question of whether common.fileExists is very aptly named or not... it uses accessSync under the hood rather than existsSync.
There was a problem hiding this comment.
I mentioned this somewhere else recently. fs.existsSync() was marked for deprecation a while back, so common.fileExists() was added to take its place in the tests. After enough user outrage feedback, existsSync() was undeprecated. common.fileExists() is now redundant and should be removed #codeandlearn #goodfirstcontribution.
There was a problem hiding this comment.
@cjihrig @apapirovski Thank you for review.
Should I replace common.fileExists with fs.existsSync ?
There was a problem hiding this comment.
I got it. I'll update it.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/11960/ (given the changes a new one is needed) |
|
Landed in bf26d92 |
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #17446 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
replace
fs.accessSyncwithcommon.fileExistsintest/parallel/test-npm-install.js.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test