From 034c77af21f21aec40dc5f2c573a5551135b5a0b Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:32:53 +0300 Subject: [PATCH] Rework Cypress check uncaught exception. (#3353) * Fix uncaught:exception * Rename var --- tests/cypress/support/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index 2a064b04..55b780d9 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -17,10 +17,10 @@ before(() => { cy.closeModalUnsupportedPlatform(); }); -const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; +const resizeObserverLoopErr = 'ResizeObserver loop limit exceeded'; 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; } });