mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
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:
1 parent
c73d0b1c5b
commit
30bff4ad47
1 file changed
+3
-2
@@ -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));
|
||||
Reference in new issue
Block a user