PR-579798: trying to fix Cypress component testing.

This commit is contained in:
Alejandro Lembke Barrientos 2023-03-07 12:06:22 -06:00
parent dbaa73eb08
commit 1ab87ac994
2 changed files with 11 additions and 6 deletions

View File

@ -17,12 +17,12 @@
import '../../src/frontend/styles/global.scss'; import '../../src/frontend/styles/global.scss';
// Import commands.js using ES2015 syntax: // Import commands.js using ES2015 syntax:
import './commands' import './commands';
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:
// require('./commands') // require('./commands')
import { mount } from 'cypress/react18' import { mount } from 'cypress/react18';
// Augment the Cypress namespace to include type definitions for // Augment the Cypress namespace to include type definitions for
// your custom command. // 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: // Example use:
// cy.mount(<MyComponent />) // cy.mount(<MyComponent />)

View File

@ -14,7 +14,7 @@
// *********************************************************** // ***********************************************************
// Import commands.js using ES2015 syntax: // Import commands.js using ES2015 syntax:
import './commands' import './commands';
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:
// require('./commands') // require('./commands')