Skip to content

test: use destructuring on require - #24455

Closed
juanarbol wants to merge 1 commit into
nodejs:masterfrom
juanarbol:test-tick-destructuring
Closed

test: use destructuring on require#24455
juanarbol wants to merge 1 commit into
nodejs:masterfrom
juanarbol:test-tick-destructuring

Conversation

@juanarbol

@juanarboljuanarbol commented Nov 17, 2018

Copy link
Copy Markdown
Member

Uses destructuring for spawn, spawnSync and writeFileSync require intest-tick-processor-polyfill-brokenfile.js

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Nov 17, 2018
@Trott

Copy link
Copy Markdown
Member

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.

@juanarbol

Copy link
Copy Markdown
MemberAuthor

I took idea from Nodetodo, just make more clear an specific test. It's quite hard find anything to help ☹️

@Trott

Copy link
Copy Markdown
Member

I took idea from Nodetodo

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?

It's quite hard find anything to help

I'll email you a suggested task.

@juanarbol

Copy link
Copy Markdown
MemberAuthor

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.
Thanks for reviewing! Feels so good haha

@Trott

Copy link
Copy Markdown
Member

Sure, I saw this commit in Nodetodo's list

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.

@addaleax

Copy link
Copy Markdown
Member

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 23, 2018
@addaleax

Copy link
Copy Markdown
Member

@addaleax

Copy link
Copy Markdown
Member

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/.)

pullBot pushed a commit to SimenB/node that referenced this pull request Nov 24, 2018
PR-URL: nodejs#24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this pull request Nov 24, 2018
PR-URL: #24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
rvagg pushed a commit that referenced this pull request Nov 28, 2018
PR-URL: #24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BridgeARBridgeAR mentioned this pull request Dec 5, 2018
4 tasks
codebytere pushed a commit that referenced this pull request Jan 13, 2019
PR-URL: #24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
PR-URL: nodejs#24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@codebyterecodebytere mentioned this pull request Jan 15, 2019
codebytere pushed a commit that referenced this pull request Jan 29, 2019
PR-URL: #24455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@juanarbol@Trott@addaleax@jasnell@trivikr@nodejs-github-bot