-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: use destructuring on require #24455
Conversation
Hi, @juanarbol! Welcome and thanks for the pull request! The change is fine, I guess, but it's not clear to me that this is a significant improvement over the existing code. Curious to get the opinion of other collaborators. |
I took idea from Nodetodo, just make more clear an specific test. It's quite hard find anything to help |
I'm not sure what you mean. There's nothing on the Node Todo website that suggests that introducing destructuring in a situation like this is desirable. Can you point me to where you got the suggestion?
I'll email you a suggested task. |
Sure, I saw this commit in Nodetodo's list (Commits From NodeTodo Activities), it's kind of a code refactor of a particular unit test. I read some test files and found almost same "problem" in this particular file changed on this commit (mine), It's like an inspiration, I guess. |
Ah, I see. That commit uses destructuring to replace assigning a property to a variable. This change, though, replaces a require() without a property being assigned. The former arguably improves readability. I'm not sure this has the same effect. |
Landed in e0893f0 Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.) |
PR-URL: nodejs#24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: nodejs#24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #24455 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Uses destructuring for
spawn
,spawnSync
andwriteFileSync
require intest-tick-processor-polyfill-brokenfile.js
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes