Skip to content

Commit 8466be6

Browse files
committed
Prevent resize observer loop error from failing cypress tests
1 parent ad1abd7 commit 8466be6

File tree

1 file changed

+8
-0
lines changed
  • {{ cookiecutter.project_slug }}/e2e/cypress/support

1 file changed

+8
-0
lines changed

{{ cookiecutter.project_slug }}/e2e/cypress/support/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
import './commands';
2+
const resizeObserverLoopErrRe = /^ResizeObserver loop limit exceeded/
3+
4+
Cypress.on('uncaught:exception', (err) => {
5+
if (resizeObserverLoopErrRe.test(err.message)) {
6+
// returning false here prevents Cypress from failing the test
7+
return false;
8+
}
9+
});
210

311
beforeEach(() => {
412
cy.visit('/');

0 commit comments

Comments
 (0)