Skip to content

Commit

Permalink
test: change forEach to for...of
Browse files Browse the repository at this point in the history
PR-URL: #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 committed Oct 6, 2023
1 parent 24dea23 commit 42c37f2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/parallel/test-assert.js
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 42c37f2

Please sign in to comment.