Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Listen for console errors in browser tests

Gabe Kangas1109ca21ed1e
diff --git a/test/automated/browser/cypress/support/setup.js b/test/automated/browser/cypress/support/setup.js
index 94614c5240..9258db6e94 100644
--- a/test/automated/browser/cypress/support/setup.js
+++ b/test/automated/browser/cypress/support/setup.js
@@ -1,6 +1,20 @@
export function setup() {
+ let windowErrorSpy;
+
+ Cypress.on('window:before:load', (win) => {
+ windowErrorSpy = cy.spy(win.console, 'error');
+ });
+
Cypress.on(
'uncaught:exception',
(err) => !err.message.includes('ResizeObserver loop limit exceeded')
);
+
+ describe('Listen for errors', () => {
+ afterEach(() => {
+ cy.wait(1000).then(() => {
+ expect(windowErrorSpy).to.not.be.called;
+ });
+ });
+ });
}