You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: these tests are using 'uncaught:exception' to catch runtime errors, and assert that they are happening correctly. EG:
before(()=>{Cypress.on('uncaught:exception',()=>{// returning false here prevents Cypress from// failing the testreturnfalse;});});it('should throw error, when a fragment is supplied as children',done=>{cy.on('uncaught:exception',err=>{expect(err.message).to.include(ERROR_TEXT);done();returnfalse;});mount(<AppHeaderBarNavItemtestId="nav1"><>moo</></AppHeaderBarNavItem>,);});
The text was updated successfully, but these errors were encountered:
glomotion
changed the title
Problems with cypress 7.5.0 and 'uncaught:exception' handling
Problems with cypress 7.5.0 & @cyprss/react and 'uncaught:exception' handling
Jun 9, 2021
I looked at the situation, something is wrong because when the error is thrown Cypress CT tries to mount the component again causing the problem. You can find my simplified test in https://github.com/bahmutov/double-error-bug
npm install
npm run test:watch
I am printing the log message before throwing the error
if(typeofchildren==='string'||isReactFragment(children)||!isChildReactComponent(children)){console.error('App throwing an error')throwError(ERROR_TEXT);}
I see the double log message in the console, which is incorrect
Current behavior
REPRO: https://github.com/glomotion/cypress-bug-repro
When running headless tests WITH coverage enabled, cypress errors out (
npm run test
)However when running headed or with coverage DISABLED, cypress tests pass as they should (
npm run test:fast
ornpm run test:watch
)Desired behavior
Tests should pass in all modes or fail in all modes 🤪 🤷
Test code to reproduce
REPRO: https://github.com/glomotion/cypress-bug-repro
NOTE: these tests are using 'uncaught:exception' to catch runtime errors, and assert that they are happening correctly. EG:
Versions
MacOS: 11.4 (20F71)
MacBook Pro (15-inch, 2019)
The text was updated successfully, but these errors were encountered: