The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { truncate } from "./String.ts"; |
| 4 | |
| 5 | describe("truncate", () => { |
| 6 | it("cuts by Unicode code point so emoji stay whole", () => { |
| 7 | expect(truncate("👍👍👍", 5)).toBe("👍👍👍"); |
| 8 | expect(truncate("👍👍👍👍", 3)).toBe("👍👍👍..."); |
| 9 | }); |
| 10 | |
| 11 | it("trims before measuring", () => { |
| 12 | expect(truncate(" hello ", 5)).toBe("hello"); |
| 13 | }); |
| 14 | }); |