-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: coverage for util.promisify #17591
Conversation
test/parallel/test-util-promisify.js
Outdated
() => promisify(undefined), | ||
{ | ||
code: 'ERR_INVALID_ARG_TYPE', | ||
type: Error, |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 !
There was a problem hiding this comment.
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.
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@maclover7 : Thanks for the feedback. I've updated the commit message. Kindly review now! |
@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 😃 |
@BridgeAR : I'm sorry I missed to update the checklist before. I've updated it now. Kindly review. Thanks ! |
There was a problem hiding this 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 */)
@apapirovski : Thanks for your feedback. I've updated the PR. Kindly review now! |
Landed in f86427e Thanks @mithunsasidharan! |
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
Added missing coverage for scenario where it throws when a non function is passed as argument to
Util.Promisify
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test