Open History to see the last commit
1import { expect, it } from "vite-plus/test";
2β
3import { errorDetailsPreview } from "./RenderErrorBoundary.logic";
4β
5it("previews the first line up to 300 units without splitting an emoji", () => {
6 expect(errorDetailsPreview(`${"a".repeat(299)}π more`)).toBe("a".repeat(299));
7 expect(errorDetailsPreview(`${"a".repeat(298)}π more`)).toBe(`${"a".repeat(298)}π`);
8 expect(errorDetailsPreview("TypeError: boom π\n at render")).toBe("TypeError: boom π");
9});