Skip to content

test: replace forEach() with for...of in parallel tests - #65272

Open
pmarkert wants to merge 1 commit into
nodejs:mainfrom
pmarkert:main
Open

test: replace forEach() with for...of in parallel tests#65272
pmarkert wants to merge 1 commit into
nodejs:mainfrom
pmarkert:main

Conversation

@pmarkert

Copy link
Copy Markdown

test: replace forEach() with for...of in parallel tests

Replace Array.prototype.forEach() with for...of loops across 17
tests in test/parallel, so each loop body reads as a plain statement
rather than an arrow callback.

None of the iterated values are sparse arrays, the one case where
forEach and for...of genuinely differ, so both constructs visit the
same elements in the same order. No callback relied on this, an early
return, or async behaviour, and the number of assertions run in each
file is unchanged.

Replace `Array.prototype.forEach()` with `for...of` loops across 17
tests in `test/parallel`, so each loop body reads as a plain statement
rather than an arrow callback.

None of the iterated values are sparse arrays, the one case where
`forEach` and `for...of` genuinely differ, so both constructs visit the
same elements in the same order. No callback relied on `this`, an early
return, or async behaviour, and the number of assertions run in each
file is unchanged.

Signed-off-by: Phillip Markert <phillip@ephisys.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Aug 13, 2026
@jasnell jasnell added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Aug 13, 2026
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 13, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 13, 2026
@nodejs-github-bot

nodejs-github-bot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 14, 2026
@jasnell

jasnell commented Aug 14, 2026

Copy link
Copy Markdown
Member

Awesome! This passed CI and will be ready to land. If there's another sign off, it can land after 48 hours of opening. If no one else signs off, then it will be one week. But otherwise, it is ready to go. Thank you for participating in the code and learn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants