2022-11-05 04:04:13 +01:00
|
|
|
export function setup() {
|
2022-12-09 03:36:41 +01:00
|
|
|
let windowErrorSpy;
|
|
|
|
|
|
|
|
Cypress.on('window:before:load', (win) => {
|
|
|
|
windowErrorSpy = cy.spy(win.console, 'error');
|
|
|
|
});
|
|
|
|
|
2022-11-05 04:04:13 +01:00
|
|
|
Cypress.on(
|
|
|
|
'uncaught:exception',
|
|
|
|
(err) => !err.message.includes('ResizeObserver loop limit exceeded')
|
|
|
|
);
|
2022-12-09 03:36:41 +01:00
|
|
|
|
|
|
|
describe('Listen for errors', () => {
|
|
|
|
afterEach(() => {
|
|
|
|
cy.wait(1000).then(() => {
|
|
|
|
expect(windowErrorSpy).to.not.be.called;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2022-11-05 04:04:13 +01:00
|
|
|
}
|