Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2β
3import { sanitizeCommitSubject } from "./textGenerationUtils.ts";
4β
5describe("sanitizeCommitSubject", () => {
6 // regression: #19181 truncation split grapheme clusters at the subject limit
7 it.each([
8 { name: "an emoji", prefixLength: 71, character: "π" },
9 { name: "an accented character", prefixLength: 71, character: "e\u0301" },
10 { name: "a joined emoji", prefixLength: 65, character: "π¨βπ©βπ§βπ¦" },
11 ])("keeps $name intact at the subject limit", ({ prefixLength, character }) => {
12 const prefix = "a".repeat(prefixLength);
13β
14 expect(sanitizeCommitSubject(`${prefix}${character} more`)).toBe(prefix);
15 });
16});