Skip to content

Commit

Permalink
test: change forEach to for...of
Browse files Browse the repository at this point in the history
PR-URL: nodejs#49799
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
tifflastimosa authored and debadree25 committed Apr 15, 2024
1 parent dfa47f0 commit cb854ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ assert.throws(() => {
{
// Bad args to AssertionError constructor should throw TypeError.
const args = [1, true, false, '', null, Infinity, Symbol('test'), undefined];
args.forEach((input) => {
for (const input of args) {
assert.throws(
() => new assert.AssertionError(input),
{
Expand All @@ -485,7 +485,7 @@ assert.throws(() => {
message: 'The "options" argument must be of type object.' +
common.invalidArgTypeHelper(input)
});
});
}
}

assert.throws(
Expand Down Expand Up @@ -965,11 +965,8 @@ assert.throws(
}
);

[
1,
false,
Symbol(),
].forEach((input) => {
const inputs = [1, false, Symbol()];
for (const input of inputs) {
assert.throws(
() => assert.throws(() => {}, input),
{
Expand All @@ -979,7 +976,7 @@ assert.throws(
common.invalidArgTypeHelper(input)
}
);
});
}

{

Expand Down

0 comments on commit cb854ac

Please sign in to comment.