- {error?.error?.message || "An unexpected error occurred"} -
- - - -Home
}, + { path: "/orders", Component: Orders }, +]; + +function renderApp( + path: string, + { + children = pages, + withDefault = true, + errorElement =Own error
}, + ], + }); + expect(await screen.findByText("Own error")).toBeTruthy(); + expect(screen.queryByText("Something went wrong")).toBeNull(); + }); +}); + +describe("ErrorPage", () => { + test("shows a thrown non-Error value in development", () => { + render(
+ {details(error)}
+
+ )}
+
+ {errorDetails(error)}
+
+ )}
+