Rework Cypress check uncaught exception. (#3353)

* Fix uncaught:exception

* Rename var
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent a17b82390f
commit 034c77af21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,10 +17,10 @@ before(() => {
cy.closeModalUnsupportedPlatform(); cy.closeModalUnsupportedPlatform();
}); });
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; const resizeObserverLoopErr = 'ResizeObserver loop limit exceeded';
Cypress.on('uncaught:exception', (err) => { Cypress.on('uncaught:exception', (err) => {
if (resizeObserverLoopErrRe.test(err.message)) { // the exception is generated by cypress in some browsers
// the exception is generated by cypress in some browsers if (err.message.includes(resizeObserverLoopErr)) {
return false; return false;
} }
}); });

Loading…
Cancel
Save