-
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: restore no-op function in test #14065
Conversation
Remove common.mustCall() in test that might connect to a server already running on the local host.
OK to fast-track this one as trivial and important to fix tests? |
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.
OK to fast-track this one as trivial and important to fix tests?
I would say so – I can’t really tell how many other people have a server on port 80 running regularly on the machine on which they run tests.
@@ -21,7 +21,7 @@ vals.forEach((v) => { | |||
// These values are OK and should not throw synchronously | |||
['', undefined, null].forEach((v) => { | |||
assert.doesNotThrow(() => { | |||
http.request({hostname: v}).on('error', common.mustCall()).end(); | |||
http.request({host: v}).on('error', common.mustCall()).end(); | |||
http.request({hostname: v}).on('error', () => {}).end(); |
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.
Maybe add a comment that we don't care about the connection just about hostname type checking?
Maybe even go as far as:
const dontCare = () => {};
http.request({hostname: v}).on('error', dontCare).end();
http.request({host: v}).on('error', dontCare).end();
Just so no one revert-reverts this
Landed in 5b1d12a |
Remove common.mustCall() in test that might connect to a server already running on the local host. PR-URL: nodejs#14065 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Remove common.mustCall() in test that might connect to a server already running on the local host. PR-URL: #14065 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Remove common.mustCall() in test that might connect to a server already running on the local host. PR-URL: #14065 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Remove common.mustCall() in test that might connect to a server already running on the local host. PR-URL: #14065 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Remove common.mustCall() in test that might connect to a server already
running on the local host.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test http