From a2667c2db3259f074e9c2d3a5d82c3a8ee9042cd Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Mon, 2 Aug 2021 11:03:02 +0200 Subject: [PATCH] Ignore all unhandled promise rejections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer Cypress fails tests in more situations than Cypress 6.8.0, but we’re not ready to investigate the root cause yet so just retain the previous behaviour for now. --- tests/ui/cypress/support/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ui/cypress/support/index.js b/tests/ui/cypress/support/index.js index 16a28dce..8bc32991 100644 --- a/tests/ui/cypress/support/index.js +++ b/tests/ui/cypress/support/index.js @@ -29,10 +29,15 @@ // Define a custom uncaught exception handling policy for Cypress. // Returning false prevents Cypress from failing the test. -Cypress.on('uncaught:exception', (err, runnable) => { +Cypress.on('uncaught:exception', (err, runnable, promise) => { console.log("Krill UI Test: Examining uncaught exception..") console.log("Krill UI Test: err: ", err) + if (promise) { + console.log("Krill UI Test: Ignoring unhandled promise rejection.") + return false + } + if (err.message) { if (err.message.includes('ResizeObserver loop limit exceeded')) { console.log("Krill UI Test: Ignoring 'ResizeObserver loop limit exceeded' exception")