test runner: global before
doesn't run if there are no global test
#48844
Labels
test_runner
Issues and PRs related to the test runner subsystem.
Version
v20.4.0
Platform
Darwin lucille.lan 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:23 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6020 arm64
Subsystem
test runner
What steps will reproduce the bug?
If you run this test with
node --test
, "before" is not printed.If you define a test outside the describe, "before" is printed
How often does it reproduce? Is there a required condition?
It's deterministic.
What is the expected behavior? Why is that the expected behavior?
The before hook should always run.
What do you see instead?
It only runs if I have a global test.
Additional information
after
doesn't seem to be affected by this issue. It always runs. This makes me believe that the intended behavior ofbefore
matches my expectations.The text was updated successfully, but these errors were encountered: