`Cypress.on('uncaught:exception')` No Longer Preventing Tests From Failing after Upgrade to `10.0.2`
See original GitHub issueCurrent behavior
Cypress is not ignoring the following error:
My cypress/support/e2e.js
file is configured so that Cypress should return false
on an uncaught:exception
in order to prevent the test from failing. This is no longer working as expected after upgrading to the latest version, 10.0.2
, as the test is failing.
Desired behavior
In this situation, Cypress should pass the it
statement while ignoring the error and throwing any specified logging.
Test code to reproduce
Cypress.on('uncaught:exception', (err) => {
// returning false here prevents Cypress from
// failing the test
console.log('Cypress detected uncaught exception: ', err);
return false;
});
Cypress Version
10.0.2
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Migration Guide | Cypress Documentation
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
Read more >node.js - Migrating cypress test from old version to latest ...
I have had many packages fail with mysterious errors when running them on the latest (Node 18). I am sure this will not...
Read more >Upgrade Cypress to Version 10 - Medium
Even though version 10 is a major version upgrade for cypress, turns out it's very simple and ... Click the “E2E Testing” to...
Read more >cypress: Versions - Openbase
Upgraded the Chromium browser version used during cypress run and when ... Hooks will no longer rerun on unrelated tests in some situations...
Read more >rouch/Cypress: Fast, easy and reliable testing for ... - NotABug
Cypress - Fast, easy and reliable testing for anything that runs in a browser.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@willoliveira-air I am going to continue our conversation on issue #22113 as I think you and @mlberkow are having the same, if not a very similar issue, i.e. a resize observer failure that is being generated from the test itself, not the application.
@danfooks since your error comes from the application itself, the problem is likely a bit different. I noticed you are using
cy.origin
, in which case you likely need a separateuncaught:exception
handler incy.origin
to catch that error and not throw it in your main test, something like: