FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test_runner: run afterEach hooks in correct order by cjihrig · Pull Request #52239 · nodejs/node · GitHub

/ node Public

test_runner: run afterEach hooks in correct order - #52239

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
cjihrig:after-each-order
Mar 30, 2024
Merged

test_runner: run afterEach hooks in correct order#52239
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
cjihrig:after-each-order

Conversation

cjihrig commented Mar 28, 2024

Copy link
Copy Markdown
Contributor

This commit updates the test runner afterEach hook so that the current test's afterEach hooks run before any ancestor afterEach hooks.

Fixes: #51671

This commit updates the test runner afterEach hook so that the
current test's afterEach hooks run before any ancestor afterEach
hooks.

Fixes: nodejs#51671

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Mar 28, 2024
MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 28, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 28, 2024

Copy link
Copy Markdown
Collaborator

Comment on lines +565 to +566
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount, 0, hook);
this.hooks.ownAfterEachCount++;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount, 0, hook);
this.hooks.ownAfterEachCount++;
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount++, 0, hook);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I personally find that a little less readable, only because the splice line is already a bit busy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK, works for me 🙂

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

cjihrig added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Mar 28, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 30, 2024
nodejs-github-bot merged commit 7c02486 into nodejs:main Mar 30, 2024

Copy link
Copy Markdown
Collaborator

Landed in 7c02486

cjihrig deleted the after-each-order branch March 30, 2024 13:18
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
This commit updates the test runner afterEach hook so that the
current test's afterEach hooks run before any ancestor afterEach
hooks.

Fixes: #51671
PR-URL: #52239
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
This commit updates the test runner afterEach hook so that the
current test's afterEach hooks run before any ancestor afterEach
hooks.

Fixes: #51671
PR-URL: #52239
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order of nested vs outer afterEach hooks is unexpected and inconsistent with after

4 participants


Back | FazBrowse Home | New Git URL