-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
beforeEach/afterEach hooks not executing for nested tests #47643
Comments
hmm, I think fixing this will be a breaking change. @nodejs/test_runner WDYT? |
I think this depends if it's expected or not. If the current behaviour isn't the expected behaviour, then it's a bug that should simply be fixed. If it is the expected behaviour (which would surprise me since it differs from all
The problem is that currently they're executed for the nested suite, so if tests were to inherit, then the first test would have the |
I think it's just a bug and should probably just be fixed? |
It's named "before each" so if it doesn't run before each, then it's just a bug - I agree it should just be fixed. |
PR-URL: nodejs#47648 Fixes: nodejs#47643 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#47648 Fixes: nodejs#47643 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#47648 Fixes: nodejs#47643 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#47648 Fixes: nodejs#47643 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Version
v20.0.0
Platform
Darwin Rochs-MBP.localdomain 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64
Subsystem
node:test
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
beforeEach
andafterEach
should be running before every test even when nested, not when the nested suite starts running.What do you see instead?
beforeEach
andafterEach
only run once for nested test suites.Additional information
No response
The text was updated successfully, but these errors were encountered: