From 42b162b06d49dbcfcf85331cd6bec0b9e5dab7b2 Mon Sep 17 00:00:00 2001 From: Jia Date: Tue, 7 Nov 2023 10:31:57 -0500 Subject: [PATCH] test: replace forEach() with for...of Replace `forEach()` with `for...of` in `test/parallel/test-assert-typedarray-deepequal.js`. PR-URL: https://github.com/nodejs/node/pull/50610 Reviewed-By: Luigi Pinca --- test/parallel/test-assert-typedarray-deepequal.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-assert-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js index a31da2739af93e..aee5225ca1fe51 100644 --- a/test/parallel/test-assert-typedarray-deepequal.js +++ b/test/parallel/test-assert-typedarray-deepequal.js @@ -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]), @@ -88,4 +88,4 @@ notEqualArrayPairs.forEach((arrayPair) => { makeBlock(assert.deepStrictEqual, arrayPair[0], arrayPair[1]), assert.AssertionError ); -}); +}