mirror of https://github.com/nodejs/node.git
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
parent
017122a6ec
commit
5bbae25177
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue