Skip to content

Commit 27a6cfd

Browse files
Andrea BarbassoFrancescoMolinaro
authored andcommitted
Merged in task/dspace-cris-2025_02_x/DSC-2730_2 (pull request DSpace#4112)
[DSC-2730] move cy uncaught exception handling outside wrapper Approved-by: Francesco Molinaro
2 parents a4167f1 + 9dbcdf7 commit 27a6cfd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cypress/support/e2e.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ import 'cypress-axe';
2121

2222
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
2323

24+
// We might receive uncaught exceptions from external libraries (e.g. it happened before with a broken
25+
// version of the addToAny plugin). These should not cause our tests to fail, so we catch them here.
26+
Cypress.on('uncaught:exception', (err, runnable) => {
27+
// returning false here prevents Cypress from failing the test
28+
return false;
29+
});
30+
2431
// Runs once before all tests
2532
before(() => {
2633
// Cypress doesn't have access to the running application in Node.js.
@@ -50,13 +57,6 @@ before(() => {
5057
cy.task('saveRestBaseDomain', baseDomain);
5158

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

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

0 commit comments

Comments
 (0)