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_runner: replace forEach() with for ... of #50595

Conversation

tomhaddad
Copy link
Contributor

@tomhaddad tomhaddad commented Nov 7, 2023

Replaces usage of forEach() with for ... of in test-runner-mock-timers.js
#NodeConf

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@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 Nov 7, 2023
@ljharb
Copy link
Member

ljharb commented Nov 7, 2023

why? assert.forEach isn’t the same as a for..of loop.

@marco-ippolito marco-ippolito added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 7, 2023
@tomhaddad tomhaddad force-pushed the test-runner-mock-timers-replace-foreach branch from 853f68e to 18bd8aa Compare November 7, 2023 15:23
@tomhaddad tomhaddad force-pushed the test-runner-mock-timers-replace-foreach branch from 18bd8aa to d907f14 Compare November 7, 2023 15:28
Copy link
Member

@atlowChemi atlowChemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tomhaddad, what is the reason for this change?
This is not a part of core in which we avoid prototype calls like forEach()

@lpinca
Copy link
Member

lpinca commented Nov 7, 2023

@atlowChemi it's a code-and-learn exercise.

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2023
@nodejs-github-bot
Copy link
Collaborator

@ljharb
Copy link
Member

ljharb commented Nov 7, 2023

That doesn’t mean the change should just land tho, right? Or does it mean the PR isn’t going to actually land, it’s just to demonstrate how to do one?

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: this is a test file, we do not have any requirements for how to iterate over arrays in test files, both methods are fine by me.

@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Nov 8, 2023

That doesn’t mean the change should just land tho, right? Or does it mean the PR isn’t going to actually land, it’s just to demonstrate how to do one?

As any PR, this can land after if it has approval and green CI, after the waiting time. Code and Learn consists on making low hanging fruit PRs to get a first contribution to the repo, with the hope that it will result in more contributions in the future.

Thanks for the PR @tomhaddad :)

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 8, 2023
@tomhaddad
Copy link
Contributor Author

Thanks for the PR @tomhaddad :)

You are most welcome, happy to have made my first contribution :)

@aduh95 aduh95 added the fast-track PRs that do not need to wait for 48 hours to land. label Nov 8, 2023
Copy link
Contributor

github-actions bot commented Nov 8, 2023

Fast-track has been requested by @aduh95. Please 👍 to approve.

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2023
@nodejs-github-bot nodejs-github-bot merged commit 8588ee1 into nodejs:main Nov 8, 2023
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 8588ee1

targos pushed a commit that referenced this pull request Nov 11, 2023
PR-URL: #50595
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
targos pushed a commit that referenced this pull request Nov 14, 2023
PR-URL: #50595
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
PR-URL: #50595
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
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. fast-track PRs that do not need to wait for 48 hours to land. 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.

9 participants