-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
describe
block without it
does not trigger hooks
#45028
Labels
test_runner
Issues and PRs related to the test runner subsystem.
Comments
It looks like nested @MoLow is this a bug or intended behavior? I don't know what other test runners do in this case, but I'm leaning toward bug. |
scally
changed the title
Nested suite beforeEach context works for
Oct 16, 2022
test
but not describe
describe
block without it
does not trigger hooks
FWIW, this works in Jest |
this is not intended |
cjihrig
added a commit
to cjihrig/node
that referenced
this issue
Oct 25, 2022
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs#45028
cjihrig
added a commit
to cjihrig/node
that referenced
this issue
Oct 25, 2022
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs#45028
MoLow
pushed a commit
to MoLow/node
that referenced
this issue
Nov 23, 2022
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs#45028 PR-URL: nodejs#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MoLow
pushed a commit
to MoLow/node
that referenced
this issue
Nov 23, 2022
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs#45028 PR-URL: nodejs#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MoLow
pushed a commit
to MoLow/node
that referenced
this issue
Dec 9, 2022
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs#45028 PR-URL: nodejs#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MoLow
pushed a commit
to MoLow/node-core-test
that referenced
this issue
Feb 2, 2023
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs/node#45028 PR-URL: nodejs/node#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> (cherry picked from commit a69a30016cf3395b0bd775c1340ab6ecbac58296)
MoLow
pushed a commit
to MoLow/node-core-test
that referenced
this issue
Feb 2, 2023
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs/node#45028 PR-URL: nodejs/node#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> (cherry picked from commit a69a30016cf3395b0bd775c1340ab6ecbac58296)
MoLow
pushed a commit
to MoLow/node-core-test
that referenced
this issue
Feb 2, 2023
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs/node#45028 PR-URL: nodejs/node#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> (cherry picked from commit a69a30016cf3395b0bd775c1340ab6ecbac58296)
MoLow
pushed a commit
to MoLow/node-core-test
that referenced
this issue
Feb 2, 2023
Prior to this commit, beforeEach() and afterEach() hooks were not called on test suites (describe()). This commit addresses that. Fixes: nodejs/node#45028 PR-URL: nodejs/node#45161 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> (cherry picked from commit a69a30016cf3395b0bd775c1340ab6ecbac58296)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
18.9.0
Platform
Darwin Eorzea.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
Subsystem
node:test
What steps will reproduce the bug?
Nested
beforeEach
contexts do not work withdescribe
/it
:The output looks like this, a failure, due to what seems is only the inner
beforeEach
being run:The same style of suite
beforeEach
nesting works withtest
Outputs:
How often does it reproduce? Is there a required condition?
Always reproduces
What is the expected behavior?
Nested test contexts should work the same whether you are using
describe
/it
ortest
What do you see instead?
The expected and actual outputs are in the repro example above
Additional information
No response
The text was updated successfully, but these errors were encountered: