Skip to content

Commit 276d4c2

Browse files
Andrea BarbassoFrancescoMolinaro
authored andcommitted
Merged in task/dspace-cris-2024_02_x/DSC-2774 (pull request DSpace#4192)
[DSC-2774] do not fail e2e tests on uncaught exceptions Approved-by: Francesco Molinaro
2 parents f997df5 + 24a6932 commit 276d4c2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cypress/support/e2e.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ before(() => {
5757
cy.task('saveRestBaseDomain', baseDomain);
5858

5959
});
60+
61+
// We might receive uncaught exceptions from external libraries (e.g. it happened before with a broken
62+
// version of the addToAny plugin). These should not cause our tests to fail, so we catch them here.
63+
Cypress.on('uncaught:exception', (err, runnable) => {
64+
// returning false here prevents Cypress from failing the test
65+
return false;
66+
});
6067
});
6168

6269
// Runs once before the first test in each "block"

0 commit comments

Comments
 (0)