Skip to content

Commit 48efcc0

Browse files
author
Andrea Barbasso
committed
[DSC-2740] avoid capturing unhandled exceptions during e2e tests
1 parent 8209921 commit 48efcc0

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
@@ -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.

0 commit comments

Comments
 (0)