Skip to content
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: cover util.inspect on boxed primitive with colors #27897

Conversation

pinguinjkeke
Copy link
Contributor

This PR adds a coverage for util.inspect's colored boxed primitive test-util-inspect.js L868

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label May 26, 2019
@addaleax

This comment has been minimized.

@ChALkeR ChALkeR added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label May 26, 2019
@pinguinjkeke pinguinjkeke force-pushed the util-inspect-box-primitive-colors branch from 0d5e08d to c9b4b43 Compare May 26, 2019 14:24
@pinguinjkeke
Copy link
Contributor Author

@addaleax done

@addaleax addaleax changed the title inspector: cover util.inspect on boxed primitive with colors test: cover util.inspect on boxed primitive with colors May 26, 2019
@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 26, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ryzokuken
Copy link
Contributor

Thanks everyone! Will land this as soon as 48 hours are up.

@Trott
Copy link
Member

Trott commented May 28, 2019

/ping @BridgeAR

@ryzokuken
Copy link
Contributor

@Trott I'd prefer if @BridgeAR gave his explicit approval, but that said, I believe he personally made this task for the event so it should be fine, really.

@Trott
Copy link
Member

Trott commented May 28, 2019

@Trott I'd prefer if @BridgeAR gave his explicit approval, but that said, I believe he personally made this task for the event so it should be fine, really.

Cool. It was just a ping, not a "don't land this until he reviews it". Pinging because I was surprised he hadn't reviewed it yet and figured he'd likely have an opinion. No problem from me with landing it.

@ryzokuken
Copy link
Contributor

@Trott haha, no need to explain, I understood, just wanted to explicitly mention my thoughts. 😇

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost done but it will not yet cover the mentioned line. There is a fast path that is taken to prevent to toLowerCase() from being called if there are no extra properties on the object.
To cover it, add any regular property to the boxed primitive before passing it to util.inspect.

@BridgeAR
Copy link
Member

@Trott thanks, my mailbox got a pile of mentions and I'll go through them later on today. I am just a bit busy that I did not get to it before.

@ryzokuken
Copy link
Contributor

@pinguinjkeke could you please address @BridgeAR's comments above and then we could land this?

@pinguinjkeke
Copy link
Contributor Author

@BridgeAR I'm trying to hit return ctx.stylize(base, type.toLowerCase()); line.
And my test is hitting it.
If I'll add extra property to the box primitive it will hit return base; line 🤔

@BridgeAR
Copy link
Member

@pinguinjkeke you are right, I did not read the code line correctly!

@ryzokuken
Copy link
Contributor

Landed in c31ac41 🎉

@ryzokuken ryzokuken closed this May 29, 2019
ryzokuken pushed a commit that referenced this pull request May 29, 2019
PR-URL: #27897
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request May 31, 2019
PR-URL: #27897
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@targos targos mentioned this pull request Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants