Skip to content

Commit

Permalink
test: move to for of loop in test-http-hostname-typechecking.js
Browse files Browse the repository at this point in the history
PR-URL: #50782
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
  • Loading branch information
Puppo authored and RafaelGSS committed Jan 2, 2024
1 parent 876743e commit 88e8651
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-http-hostname-typechecking.js
Expand Up @@ -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();
});
}

0 comments on commit 88e8651

Please sign in to comment.