-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { createCypress } = require('../support/helpers') | ||
const { runIsolatedCypress } = createCypress() | ||
|
||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. Should we add more tests for different cases like There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
runIsolatedCypress(() => { | ||
before(() => { | ||
beforeEach(() => { | ||
}) | ||
}) | ||
|
||
describe('s1', () => { | ||
it('t1', () => { | ||
// | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,11 +237,6 @@ function createCypress (defaultOptions = {}) { | |
if (testsInOwnFile) return | ||
|
||
generateMochaTestsForWin(specWindow, mochaTestsOrFile) | ||
specWindow.before = () => {} | ||
specWindow.beforeEach = () => {} | ||
specWindow.afterEach = () => {} | ||
specWindow.after = () => {} | ||
specWindow.describe = () => {} | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will see if this was added for a reason... |
||
|
||
cy.stub(autCypress, 'run').snapshot(enableStubSnapshots).log(false).callsFake(runIsolatedCypress) | ||
|
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 😅