mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: move to for of loop in test-http-hostname-typechecking.js
PR-URL: https://github.com/nodejs/node/pull/50782 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
parent
e1ad7fb38d
commit
c9fe4b67dd
@ -36,7 +36,8 @@ vals.forEach((v) => {
|
||||
// These values are OK and should not throw synchronously.
|
||||
// Only testing for 'hostname' validation so ignore connection errors.
|
||||
const dontCare = () => {};
|
||||
['', undefined, null].forEach((v) => {
|
||||
const values = ['', undefined, null];
|
||||
for (const v of values) {
|
||||
http.request({ hostname: v }).on('error', dontCare).end();
|
||||
http.request({ host: v }).on('error', dontCare).end();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user