From 7f301e04be7d982632fb2d6524da8120a917389a Mon Sep 17 00:00:00 2001 From: Luca Del Puppo Date: Fri, 22 Dec 2023 07:06:01 +0100 Subject: [PATCH] test: move to for of loop in test-http-hostname-typechecking.js PR-URL: https://github.com/nodejs/node/pull/50782 Reviewed-By: Rafael Gonzaga Reviewed-By: Marco Ippolito --- test/parallel/test-http-hostname-typechecking.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-http-hostname-typechecking.js b/test/parallel/test-http-hostname-typechecking.js index bcb175ee34171b..368766e087014b 100644 --- a/test/parallel/test-http-hostname-typechecking.js +++ b/test/parallel/test-http-hostname-typechecking.js @@ -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(); -}); +}