You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We show DOM errors in the console while developing, but we don't enforce any test to fail on those occurrences.
Since we have already merged PRs with DOM errors in our codebase (E.G. clickable elements like anchors rendered inside other clickable elements), we should find a way to prevent that.
The most straightforward approach will be re-using tests to render elements (i.e. the Cypress tests) to catch those occurrences.
There are libraries that do that (E.G. https://www.npmjs.com/package/cypress-fail-on-console-error). If those work, it should require only minimal setup.
Otherwise, we might need to catch the console errors manually (E.G: Cypress.on('window:before:load', (win) => { cy.spy(win.console, 'error').as('consoleError'); }); ) and fail the test (cy.get('@consoleError').should('not.have.been.called');).
The text was updated successfully, but these errors were encountered:
We show DOM errors in the console while developing, but we don't enforce any test to fail on those occurrences.
Since we have already merged PRs with DOM errors in our codebase (E.G. clickable elements like anchors rendered inside other clickable elements), we should find a way to prevent that.
The most straightforward approach will be re-using tests to render elements (i.e. the Cypress tests) to catch those occurrences.
There are libraries that do that (E.G. https://www.npmjs.com/package/cypress-fail-on-console-error). If those work, it should require only minimal setup.
Otherwise, we might need to catch the console errors manually (E.G:
Cypress.on('window:before:load', (win) => { cy.spy(win.console, 'error').as('consoleError'); });
) and fail the test (cy.get('@consoleError').should('not.have.been.called');
).The text was updated successfully, but these errors were encountered: