diff --git a/integration/root-route-test.ts b/integration/root-route-test.ts index c31dfd9adc..13b4b3c035 100644 --- a/integration/root-route-test.ts +++ b/integration/root-route-test.ts @@ -212,6 +212,7 @@ test.describe("root route", () => { test("Skip the Layout on subsequent client renders if Layout/ErrorBoundary throws (async)", async ({ page, + browserName, }) => { let oldConsoleError; oldConsoleError = console.error; @@ -271,9 +272,15 @@ test.describe("root route", () => { expect(await app.page.$("#layout")).toBeNull(); expect(await app.getHtml("title")).toMatch("Application Error"); expect(await app.getHtml("h1")).toMatch("Application Error"); - expect(await app.getHtml("pre")).toMatch( - "TypeError: Cannot read properties of null" - ); + if (browserName === "chromium") { + expect(await app.getHtml("pre")).toMatch( + "TypeError: Cannot read properties of null" + ); + } else { + // Other browsers don't include the error message in the stack trace so just + // ensure we get the `
` rendered + expect(await app.getHtml("pre")).toMatch("color: red;"); + } console.error = oldConsoleError; }); @@ -335,6 +342,7 @@ test.describe("root route", () => { test("Skip the Layout on subsequent client renders if the Layout/DefaultErrorBoundary throws (async)", async ({ page, + browserName, }) => { let oldConsoleError; oldConsoleError = console.error; @@ -391,9 +399,16 @@ test.describe("root route", () => { expect(await app.page.$("#layout")).toBeNull(); expect(await app.getHtml("title")).toMatch("Application Error"); expect(await app.getHtml("h1")).toMatch("Application Error"); - expect(await app.getHtml("pre")).toMatch( - "TypeError: Cannot read properties of null" - ); + + if (browserName === "chromium") { + expect(await app.getHtml("pre")).toMatch( + "TypeError: Cannot read properties of null" + ); + } else { + // Other browsers don't include the error message in the stack trace so just + // ensure we get the `` rendered + expect(await app.getHtml("pre")).toMatch("color: red;"); + } console.error = oldConsoleError; });