mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
1 parent
017122a6ec
commit
5bbae25177
1 file changed
+3
-3
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user