Skip to content

Conversation

@tomhaddad
Copy link
Contributor

@tomhaddadtomhaddad 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-botnodejs-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

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

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

@atlowChemiatlowChemi 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.

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2023
@github-actionsgithub-actionsbot 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

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

@aduh95aduh95 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

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 :)

@aduh95aduh95 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
ContributorAuthor

Thanks for the PR @tomhaddad :)

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

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

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

@MoLowMoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2023
@nodejs-github-botnodejs-github-bot merged commit 8588ee1 into nodejs:mainNov 8, 2023
@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 <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
@targostargos mentioned this pull request Nov 12, 2023
targos pushed a commit that referenced this pull request Nov 14, 2023
PR-URL: #50595 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
PR-URL: #50595 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
@UlisesGasconUlisesGascon mentioned this pull request Dec 12, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.fast-trackPRs that do not need to wait for 48 hours to land.needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@tomhaddad@nodejs-github-bot@ljharb@lpinca@aduh95@benjamingr@MoLow@atlowChemi@marco-ippolito