Skip to content

Commit 123b694

Browse files
Andrea BarbassoFrancescoMolinaro
authored andcommitted
Merged in task/dspace-cris-2023_02_x/DSC-2774 (pull request DSpace#4191)
[DSC-2774] do not fail e2e tests on uncaught exceptions Approved-by: Francesco Molinaro
2 parents b0ad553 + 12f0fab commit 123b694

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cypress/support/e2e.ts

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

5353
});
54+
55+
// We might receive uncaught exceptions from external libraries (e.g. it happened before with a broken
56+
// version of the addToAny plugin). These should not cause our tests to fail, so we catch them here.
57+
Cypress.on('uncaught:exception', (err, runnable) => {
58+
// returning false here prevents Cypress from failing the test
59+
return false;
60+
});
5461
});
5562

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

0 commit comments

Comments
 (0)