setup.js 415 B

1234567891011121314151617181920
  1. export function setup() {
  2. let windowErrorSpy;
  3. Cypress.on('window:before:load', (win) => {
  4. windowErrorSpy = cy.spy(win.console, 'error');
  5. });
  6. Cypress.on(
  7. 'uncaught:exception',
  8. (err) => !err.message.includes('ResizeObserver loop limit exceeded')
  9. );
  10. describe('Listen for errors', () => {
  11. afterEach(() => {
  12. cy.wait(1000).then(() => {
  13. expect(windowErrorSpy).to.not.be.called;
  14. });
  15. });
  16. });
  17. }