test: refactor test-http-hostname-typechecking

* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: https://github.com/nodejs/node/pull/13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pull/14045/merge
Rich Trott 2017-06-29 16:21:23 -07:00
parent 017122a6ec
commit 5bbae25177
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
@ -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.noop).end();
http.request({host: v}).on('error', common.noop).end();
http.request({hostname: v}).on('error', common.mustCall()).end();
http.request({host: v}).on('error', common.mustCall()).end();
});
});