- include open PR metadata in git status with graceful `gh` failure handling - centralize git command execution in `GitCoreService` via `runProcess` with truncation support - add PTY spawn-helper permission fixes, shell fallback retries, and tests for new behavior
32 lines
872 B
TypeScript
32 lines
872 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { runProcess } from "./processRunner";
|
|
|
|
describe("runProcess", () => {
|
|
it("fails when output exceeds max buffer in default mode", async () => {
|
|
await expect(
|
|
runProcess(
|
|
"node",
|
|
["-e", "process.stdout.write('x'.repeat(2048))"],
|
|
{ maxBufferBytes: 128 },
|
|
),
|
|
).rejects.toThrow("exceeded stdout buffer limit");
|
|
});
|
|
|
|
it("truncates output when outputMode is truncate", async () => {
|
|
const result = await runProcess(
|
|
"node",
|
|
["-e", "process.stdout.write('x'.repeat(2048))"],
|
|
{
|
|
maxBufferBytes: 128,
|
|
outputMode: "truncate",
|
|
},
|
|
);
|
|
|
|
expect(result.code).toBe(0);
|
|
expect(result.stdout.length).toBeLessThanOrEqual(128);
|
|
expect(result.stdoutTruncated).toBe(true);
|
|
expect(result.stderrTruncated).toBe(false);
|
|
});
|
|
});
|