Ignore all unhandled promise rejections

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.
This commit is contained in:
Ximon Eighteen
2021-08-03 09:57:47 +02:00
parent 8a708c9c72
commit a2667c2db3
+6 -1
View File
@@ -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")