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: coverage for util.promisify #17591

Closed
wants to merge 1 commit into from
Closed

test: coverage for util.promisify #17591

wants to merge 1 commit into from

Conversation

mithunsasidharan
Copy link
Contributor

@mithunsasidharan mithunsasidharan commented Dec 10, 2017

Added missing coverage for scenario where it throws when a non function is passed as argument to Util.Promisify

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

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 10, 2017
@addaleax
Copy link
Member

() => promisify(undefined),
{
code: 'ERR_INVALID_ARG_TYPE',
type: Error,
Copy link
Member

Choose a reason for hiding this comment

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

Please use TypeError here instead of Error.

Copy link
Member

Choose a reason for hiding this comment

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

I am going to open a PR to make that stricter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Trott : I've updated that. Kindly review now. Thanks !

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that looks 👍 to me. Thanks.

@addaleax addaleax added the util Issues and PRs related to the built-in util module. label Dec 11, 2017
Copy link
Contributor

@maclover7 maclover7 left a comment

Choose a reason for hiding this comment

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

LGTM, but can you please lowercase util.promisify in the commit message

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@mithunsasidharan mithunsasidharan changed the title test: coverage for Util.Promisify test: coverage for util.promisify Dec 12, 2017
@mithunsasidharan
Copy link
Contributor Author

@maclover7 : Thanks for the feedback. I've updated the commit message. Kindly review now!

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 12, 2017
@BridgeAR
Copy link
Member

@BridgeAR
Copy link
Member

@mithunsasidharan since you open quite a few PRs - would you be so kind and tick off the checkboxes? It just makes it easier to have a good overview of what is going on 😃

@mithunsasidharan
Copy link
Contributor Author

@BridgeAR : I'm sorry I missed to update the checklist before. I've updated it now. Kindly review. Thanks !

Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

Can this be updated to take all the various types to confirm it's not just a falsy check or something similar?

[undefined, null, true, 0, 'str', {}, [], Symbol()].forEach(/* test */)

@mithunsasidharan
Copy link
Contributor Author

@apapirovski : Thanks for your feedback. I've updated the PR. Kindly review now!

@apapirovski
Copy link
Member

@apapirovski
Copy link
Member

Landed in f86427e

Thanks @mithunsasidharan!

apapirovski pushed a commit that referenced this pull request Dec 14, 2017
Add a test that confirms that non-function arguments
passed to util.promisify throw an ERR_INVALID_ARG_TYPE
error.

PR-URL: #17591
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
Add a test that confirms that non-function arguments
passed to util.promisify throw an ERR_INVALID_ARG_TYPE
error.

PR-URL: #17591
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
@TimothyGu TimothyGu removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 13, 2018
MylesBorins pushed a commit that referenced this pull request Jan 22, 2018
Add a test that confirms that non-function arguments
passed to util.promisify throw an ERR_INVALID_ARG_TYPE
error.

PR-URL: #17591
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.