We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a02868 commit e080fb3Copy full SHA for e080fb3
test/parallel/test-http-hostname-typechecking.js
@@ -18,10 +18,12 @@ vals.forEach((v) => {
18
assert.throws(() => http.request({host: v}), errHost);
19
});
20
21
-// These values are OK and should not throw synchronously
+// These values are OK and should not throw synchronously.
22
+// Only testing for 'hostname' validation so ignore connection errors.
23
+const dontCare = () => {};
24
['', undefined, null].forEach((v) => {
25
assert.doesNotThrow(() => {
- http.request({hostname: v}).on('error', () => {}).end();
- http.request({host: v}).on('error', () => {}).end();
26
+ http.request({hostname: v}).on('error', dontCare).end();
27
+ http.request({host: v}).on('error', dontCare).end();
28
29
0 commit comments