From 1ab87ac99456fb2e86d04bcd2a2331ea861dbf4e Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Tue, 7 Mar 2023 12:06:22 -0600 Subject: [PATCH] PR-579798: trying to fix Cypress component testing. --- cypress/support/component.ts | 13 +++++++++---- cypress/support/e2e.ts | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cypress/support/component.ts b/cypress/support/component.ts index 258a8bc..f067178 100644 --- a/cypress/support/component.ts +++ b/cypress/support/component.ts @@ -17,12 +17,12 @@ import '../../src/frontend/styles/global.scss'; // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') -import { mount } from 'cypress/react18' +import { mount } from 'cypress/react18'; // Augment the Cypress namespace to include type definitions for // your custom command. @@ -36,7 +36,12 @@ declare global { } } -Cypress.Commands.add('mount', mount) +Cypress.Commands.add('mount', mount); + +Cypress.on('uncaught:exception', (err, runnable) => { + // returning false here prevents Cypress from failing the test + return false; +}); // Example use: -// cy.mount() \ No newline at end of file +// cy.mount() diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index f80f74f..598ab5f 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: -// require('./commands') \ No newline at end of file +// require('./commands')