fix(process): preserve command completion and input ownership
This commit is contained in:
1 parent
8a47cbbcce
commit
7fa54e2d62
4 files changed
+229
-37
No files matched your search
@@ -53,6 +53,21 @@ it.each([undefined, "SIGTERM"] as const)(
|
||||
},
|
||||
);
|
||||
|
||||
it.each([undefined, "SIGTERM"] as const)(
|
||||
"closes unused command input with stop signal %s",
|
||||
async (stopSignal) => {
|
||||
const result = await execFileOutput(
|
||||
process.execPath,
|
||||
[
|
||||
"-e",
|
||||
'process.stdin.resume(); process.stdin.on("end", () => process.stdout.write("input closed"));',
|
||||
],
|
||||
{ timeout: 2_000, ...(stopSignal === undefined ? {} : { stopSignal }) },
|
||||
);
|
||||
expect(result.stdout).toBe("input closed");
|
||||
},
|
||||
);
|
||||
|
||||
describe("execFileOutput", () => {
|
||||
it("ignores non-Error and incomplete failure metadata", () => {
|
||||
expect(execFileOutputFailure("failure")).toBeUndefined();
|
||||
|
||||
Reference in new issue
Block a user