From c4f84d6bf6dee908840ffc897392947f9cbe9e93 Mon Sep 17 00:00:00 2001 From: Luca Del Puppo Date: Sat, 18 Nov 2023 16:22:26 +0100 Subject: [PATCH] test: move to for of loop in test-http-hostname-typechecking.js --- 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(); -}); +}