cypress: Nesting hooks within other hooks causes the test to never finish (runs forever)
Current behavior:
Since upgrading to Cypress 5.0.0, I cannot get any tests to pass. Tests will run through all the code, but when they get to the end, the test does not get marked as passed and the timer keeps counting up.

Desired behavior:
Tests end and move on the next test/spec.
Test code to reproduce
context('Never-ending Test', function () {
it('Test', function () {
cy.visit('http://wikipedia.com')
cy.get('#searchInput')
.type('Cypress.io')
cy.get('.pure-button')
.click()
// Test never ends.
})
it('Next Test', function () {
// Test never starts.
cy.visit('http://wikipedia.com')
})
})
Versions
Cypress 5.0.0 macOS: 10.14.6 Browser: Chrome 84.0.4147.125, Firefox 79, Electron 83
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (10 by maintainers)
@todd-m-kemp I thought how to extend our recipe to allow setting global test timeout, here is the solution https://github.com/cypress-io/cypress-example-recipes/pull/549
@Bkucera : Thank you so much for that explanation; I’ve tested it out and it does appear that is exactly what is happening. 😄 I’ll have to rework that section of code to remove the nested hook if the result here is that nested hooks soon won’t be supported.