-
Notifications
You must be signed in to change notification settings - Fork 3.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
fix: 5.0 runner hangs on nested hook #8379
Conversation
Thanks for taking the time to open a PR!
|
const hookName = isHook && getHookName(r) | ||
const isBeforeEachHook = isHook && !!hookName.match(/before each/) | ||
const isAfterEachHook = isHook && !!hookName.match(/after each/) |
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.
all these isHook &&
are not very pretty 😅
specWindow.beforeEach = () => {} | ||
specWindow.afterEach = () => {} | ||
specWindow.after = () => {} | ||
specWindow.describe = () => {} | ||
}) |
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.
we will see if this was added for a reason...
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
I verified this fixes the original issue. Is tested 👍
|
||
// https://github.com/cypress-io/cypress/issues/8350 | ||
describe('issue-8350', () => { | ||
it('does not hang on nested hook', () => { |
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.
Should we add more tests for different cases like beforeEach
in beforeEach
, afterEach
in beforeEach
, before
in before
?
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.
the bug occurs when a hook is registered after the test has started, so it applies to more than just nested hooks. for that reason I think this covers it, but we could rename he test to something more generic
User facing changelog
Additional details
each
hooks inside ofeach
hooks:How has the user experience changed?
PR Tasks