Skip to content

Commit 42c37f2

Browse files
test: change forEach to for...of
PR-URL: #49799 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 24dea23 commit 42c37f2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/parallel/test-assert.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ assert.throws(() => {
476476
{
477477
// Bad args to AssertionError constructor should throw TypeError.
478478
const args = [1, true, false, '', null, Infinity, Symbol('test'), undefined];
479-
args.forEach((input) => {
479+
for (const input of args) {
480480
assert.throws(
481481
() => new assert.AssertionError(input),
482482
{
@@ -485,7 +485,7 @@ assert.throws(() => {
485485
message: 'The "options" argument must be of type object.' +
486486
common.invalidArgTypeHelper(input)
487487
});
488-
});
488+
}
489489
}
490490

491491
assert.throws(
@@ -965,11 +965,8 @@ assert.throws(
965965
}
966966
);
967967

968-
[
969-
1,
970-
false,
971-
Symbol(),
972-
].forEach((input) => {
968+
const inputs = [1, false, Symbol()];
969+
for (const input of inputs) {
973970
assert.throws(
974971
() => assert.throws(() => {}, input),
975972
{
@@ -979,7 +976,7 @@ assert.throws(
979976
common.invalidArgTypeHelper(input)
980977
}
981978
);
982-
});
979+
}
983980

984981
{
985982

0 commit comments

Comments
 (0)