Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change forEach to for...of #49799

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,16 @@ 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),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "options" argument must be of type object.' +
common.invalidArgTypeHelper(input)
common.invalidArgTypeHelper(input)
tniessen marked this conversation as resolved.
Show resolved Hide resolved
});
});
}
}

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
Loading