MCPcopy Create free account
hub / github.com/modem-dev/hunk / createLargeLineFixture

Function createLargeLineFixture

src/ui/diff/codeColumns.test.ts:7–24  ·  view source on GitHub ↗

Generate a large diff metadata fixture without checking a huge file into the repo.

(lineCount: number, widestLine: string)

Source from the content-addressed store, hash-verified

5
6/** Generate a large diff metadata fixture without checking a huge file into the repo. */
7function createLargeLineFixture(lineCount: number, widestLine: string): DiffFile {
8 const additionLines = Array.from({ length: lineCount }, (_, index) =>
9 index === lineCount - 1 ? widestLine : "x",
10 );
11
12 return {
13 agent: null,
14 id: "large-untracked",
15 metadata: {
16 additionLines,
17 deletionLines: [],
18 hunks: [],
19 } as unknown as DiffFile["metadata"],
20 patch: "",
21 path: "large-untracked.txt",
22 stats: { additions: lineCount, deletions: 0 },
23 };
24}
25
26describe("code column measurement", () => {
27 test("measures large generated fixtures without overflowing the call stack", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected