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: restore no-op function in test #14065

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/parallel/test-http-hostname-typechecking.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const common = require('../common');
require('../common');

const assert = require('assert');
const http = require('http');
Expand All @@ -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();
Copy link
Contributor

@refack refack Jul 3, 2017

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

http.request({host: v}).on('error', () => {}).end();
});
});