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 richardlau committed Mar 25, 2024
1 parent c823391 commit 7f301e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-http-hostname-typechecking.js
Original file line number Diff line number Diff line change
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 7f301e0

Please sign in to comment.