From 664697bb26e02dceb662d227a35eb28ca0eae788 Mon Sep 17 00:00:00 2001 From: Luca Del Puppo Date: Sat, 18 Nov 2023 16:22:26 +0100 Subject: [PATCH] test: replace foreach to for of loop --- 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(); -}); +}