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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
beforeAll
and afterAll
get executed if test.todo
is present in describe.skip
.
#11006
Comments
+1 |
I have observed that describe("outter", () => {
describe("inner1", () => {
beforeAll(async () => {
console.log("should not execute, but does");
});
it("is skipped", async () => {
console.log("is not executed, as expected");
});
});
describe("inner2", () => {
it.only("the only test", async () => {
console.log("is executed, as expected");
});
});
}); Is it correct to expect some suit analysis such that |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Happy to take a PR 馃憤 |
Hey @jarod-legault, it this still an issue? Because, I tried to run locally the same test scenario you shared and the |
Hasn't it been fixed in #10806 already? |
馃悰 Bug Report
If there is a describe block with a
beforeAll
and/orafterAll
and atest.todo
, thebeforeAll
and/orafterAll
will get executed even if thedescribe
is changed todescribe.skip
.To Reproduce
yarn init
.jest
withyarn add -D jest
.beforeAll.test.js
file in the root of the project.beforeAll.test.js
:npx jest beforeAll.test.js
. You will see theconsole.log
statements for thebeforeAll
andafterAll
, but not for thebeforeEach
andafterEach
.test.todo
line and runnpx jest beforeAll.test.js
. You will not see any console.log statements.Expected behavior
Having a
test.todo
should not cause thebeforeAll
andafterAll
to run in a skippeddescribe
block.Link to repl or repo (highly encouraged)
repl.it reproduction
envinfo
The text was updated successfully, but these errors were encountered: