-
-
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
#10451 - beforeAll block & tests marked with only & todo runs even if it is inside a describe.skip block #10806
Conversation
49eacac
to
0276ed8
Compare
724e76f
to
3c45ca1
Compare
@SimenB Could you please help me out with the failing CI build check? There seems to be some problem while running with Node 14.x version in MacOS latest |
3c45ca1
to
7a8cf89
Compare
7a8cf89
to
c22c726
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
you can ignore the one CI failure, it's flake
CHANGELOG.md
Outdated
- `[jest-circus]` Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped `describe` block [#10451](https://github.com/facebook/jest/issues/10451) | ||
- `[jest-jasmine2]` Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped `describe` block when it has child `tests` marked as either `only` or `todo` [#10451](https://github.com/facebook/jest/issues/10451) | ||
- `[jest-jasmine2]` Fixed the issues of child `tests` marked with `only` or `todo` getting executed even when it is inside a parent `describe` block with skipped status [#10451](https://github.com/facebook/jest/issues/10451) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be under the existent Fixes
heading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I have made the changes
return ( | ||
node.disabled || | ||
node.markedPending || | ||
(!!node.children && node.children.every(hasNoEnabledTest)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(!!node.children && node.children.every(hasNoEnabledTest)) | |
node.children?.every(hasNoEnabledTest) |
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Made the change. However since ts is prompting for a boolean
return value, without double negation it is throwing an error owing to a possible undefined
return value. So it would be !!node.children?.every(hasNoEnabledTest)
. Is it fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node.children?.every(hasNoEnabledTest) ?? false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have done the changes
49534d8
to
6687dcc
Compare
6687dcc
to
b968692
Compare
Changing as per review comment suggestion Co-authored-by: Simen Bekkhus <[email protected]>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #10451
Fixes the below issues in packages
jest-circus
&jest-jasmine2
.beforeAll
block runs even if it is inside a describe.skip block when the it block containstests
marked astodo
oronly
describe.skip
when thetests
are marked astodo
oronly
Test plan
e2e/__tests__/skipBeforeAfterAll.test.ts
packages/jest-circus/src/__tests__/afterAll.test.ts