From 1827fd134c4e653f49b4ae7317516b9a0f04791e Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Thu, 4 Jul 2024 15:00:13 +0200 Subject: [PATCH] test: ignore more ResizeObserver errors --- cypress/support/e2e.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 641209a96..9f6390ab7 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -1,6 +1,5 @@ import './commands.js' -const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/ Cypress.on('uncaught:exception', (err) => { // This prevents a benign error: // This error means that ResizeObserver was not able to deliver all @@ -8,8 +7,14 @@ Cypress.on('uncaught:exception', (err) => { // will not break). // // Source: https://stackoverflow.com/a/50387233/1319140 - if (resizeObserverLoopErrRe.test(err.message)) { - // returning false here prevents Cypress from failing the test + const errMsg = err.toString() + + if ( + errMsg.match(/ResizeObserver loop limit exceeded/) || + errMsg.match( + /ResizeObserver loop completed with undelivered notifications/ + ) + ) { return false } })