fix(process): capture complete host probe output

This commit is contained in:
morluto
2026-09-29 17:36:04 +08:00
parent dfad09e3b5
commit 6c68ff565f
8 changed files with 68 additions and 24 deletions
+16
View File
@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { execFileOutput } from "./ExecFileOutput.js";
describe("execFileOutput", () => {
it("captures output larger than Node's default execFile limit", async () => {
const marker = "tail-marker";
const result = await execFileOutput(process.execPath, [
"-e",
`process.stdout.write("x".repeat(2 * 1024 * 1024)); process.stdout.write(${JSON.stringify(marker)});`,
]);
expect(result.stdout).toHaveLength(2 * 1024 * 1024 + marker.length);
expect(result.stdout.endsWith(marker)).toBe(true);
});
});