From 30bff4ad478a4041c7fcb4fa3ccfdebd2b314c59 Mon Sep 17 00:00:00 2001 From: NIxxy25 Date: Thu, 13 Aug 2026 20:04:39 +0000 Subject: [PATCH] test: convert forEach to for in test-constant.js file Signed-off-by: NIxxy25 PR-URL: https://github.com/nodejs/node/pull/65271 Reviewed-By: James M Snell Reviewed-By: Aviv Keller --- test/parallel/test-constants.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-constants.js b/test/parallel/test-constants.js index 51023b56d4d..6ae205ca24b 100644 --- a/test/parallel/test-constants.js +++ b/test/parallel/test-constants.js @@ -14,7 +14,8 @@ assert.ok(binding.os.errno); assert.ok(binding.fs); assert.ok(binding.crypto); -['os', 'fs', 'crypto'].forEach((l) => { +const moduleNames = ['os', 'fs', 'crypto']; +for (const l of moduleNames) { for (const k of Object.keys(binding[l])) { if (typeof binding[l][k] === 'object') { // errno and signals for (const j of Object.keys(binding[l][k])) { @@ -25,6 +26,6 @@ assert.ok(binding.crypto); assert.strictEqual(binding[l][k], constants[k]); } } -}); +} assert.ok(Object.isFrozen(constants));