test: convert forEach to for in test-constant.js file

Signed-off-by: NIxxy25 <tellaoyinkansola25@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65271
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
This commit is contained in:
NIxxy25 authored and avivkeller committed 2026-08-15 13:17:42 -07:00
1 parent c73d0b1c5b
commit 30bff4ad47
1 file changed
+3 -2
+3 -2
View File
@@ -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));