Skip to content

Commit

Permalink
test: replace foreach to for of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Puppo committed Nov 18, 2023
1 parent 4e23d69 commit 664697b
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 664697b

Please sign in to comment.