Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

RenderErrorBoundary.logic.test.ts

9 lines475 Bytes

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});