Skip to content

Commit

Permalink
test: replace foreach with for of loop in test-http-hostname-typechec…
Browse files Browse the repository at this point in the history
…king.js
  • Loading branch information
Puppo committed Nov 18, 2023
1 parent a628dda commit 8aa4665
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 8aa4665

Please sign in to comment.