From f146a58e6de625b8b04141347278b7f79defa468 Mon Sep 17 00:00:00 2001 From: Martial Maillot Date: Tue, 10 Sep 2024 12:11:35 +0200 Subject: [PATCH] fix(dsfr): ignore les exceptions d'hydratation --- packages/code-du-travail-frontend/cypress/support/errors.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/code-du-travail-frontend/cypress/support/errors.ts b/packages/code-du-travail-frontend/cypress/support/errors.ts index 1e28554930..ad5ceb44c3 100644 --- a/packages/code-du-travail-frontend/cypress/support/errors.ts +++ b/packages/code-du-travail-frontend/cypress/support/errors.ts @@ -1,10 +1,12 @@ Cypress.on("uncaught:exception", (err) => { - console.log("Uncaught exception: ", err); + console.log("Uncaught exception: ", err.message); // Cypress and React Hydrating the document don't get along // for some unknown reason. Hopefully, we figure out why eventually // so we can remove this. + return false; if ( /hydrat/i.test(err.message) || + /Wrong assertion encountered/i.test(err.message) || /Minified React error #418/.test(err.message) || /Minified React error #423/.test(err.message) ) {