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
  • Loading branch information
Puppo committed Nov 21, 2023
1 parent a628dda commit c4f84d6
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 c4f84d6

Please sign in to comment.