-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
beforeAll block runs even if it is inside a describe.skip block #10451
Comments
Side note: EDIT: |
I believe the title should be beforeAll: not skipped if describe contains a test.todo. If you comment/remove let actual = 0
describe.skip('not skipped if it contains a test todo', () => {
beforeAll(() => actual++)
it('test 1', () => expect(actual).toBe(1))
it.todo('test 2')
})
describe('not skipped', () => {
it('test 3', () => expect(actual).toBe(0))
}) Side note: obviously a test should not rely on the result of another test but the purpose of the above code is to demonstrate a real-world scenario issue in a simple way. I guess that |
Good catch! Seems reasonable. |
I'm not. I'm sorry. I was unable to install Jest in my Vagrant env since upgrading npm to v7. Can't speak for SimenB but I think you have all you need to fix it. My last comment is a guess after reading PR #9931, which you might find helpful as well. |
Thanks for the inputs @cdoublev , I will go through it and will start working on it |
Hi @SimenB @cdoublev I have fixed the issue related to the Additionally I have noticed that the same behaviour is happening if the test is having |
tests with |
@SimenB Even if it is inside a
In the above case the |
ah! yes, that's correct. |
Thanks @SimenB . I have done the fixes and will raise a PR after adding few unit tests.
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
To Reproduce
Expected behavior
none of the block inside describe.skip run
Link to repl or repo (highly encouraged)
envinfo
The text was updated successfully, but these errors were encountered: