-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: run afterEach hooks in correct order #52239
Conversation
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
Review requested:
|
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount, 0, hook); | ||
this.hooks.ownAfterEachCount++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount, 0, hook); | |
this.hooks.ownAfterEachCount++; | |
ArrayPrototypeSplice(this.hooks[name], this.hooks.ownAfterEachCount++, 0, hook); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally find that a little less readable, only because the splice line is already a bit busy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, works for me 🙂
Landed in 7c02486 |
This commit updates the test runner afterEach hook so that the current test's afterEach hooks run before any ancestor afterEach hooks.
Fixes: #51671