Skip to content

Commit

Permalink
test: replace forEach() with for...of
Browse files Browse the repository at this point in the history
Replace `forEach()` with `for...of` in
`test/parallel/test-assert-typedarray-deepequal.js`.

PR-URL: #50610
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jialiu54321 authored and lpinca committed Dec 28, 2023
1 parent ff6365b commit 4560834
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-assert-typedarray-deepequal.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ const notEqualArrayPairs = [
],
];

equalArrayPairs.forEach((arrayPair) => {
for (const arrayPair of equalArrayPairs) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(arrayPair[0], arrayPair[1]);
assert.deepStrictEqual(arrayPair[0], arrayPair[1]);
});
}

looseEqualArrayPairs.forEach((arrayPair) => {
for (const arrayPair of looseEqualArrayPairs) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(arrayPair[0], arrayPair[1]);
assert.throws(
makeBlock(assert.deepStrictEqual, arrayPair[0], arrayPair[1]),
assert.AssertionError
);
});
}

notEqualArrayPairs.forEach((arrayPair) => {
for (const arrayPair of notEqualArrayPairs) {
assert.throws(
// eslint-disable-next-line no-restricted-properties
makeBlock(assert.deepEqual, arrayPair[0], arrayPair[1]),
Expand All @@ -88,4 +88,4 @@ notEqualArrayPairs.forEach((arrayPair) => {
makeBlock(assert.deepStrictEqual, arrayPair[0], arrayPair[1]),
assert.AssertionError
);
});
}

0 comments on commit 4560834

Please sign in to comment.