test(process): define synthetic child stdio state (#151096)

This commit is contained in:
Peter Steinberger
2026-09-17 13:04:21 -07:00
committed by GitHub
parent f2acb5e732
commit e02a3611b0
2 changed files with 8 additions and 1 deletions
@@ -18,6 +18,8 @@ function createChild() {
Object.defineProperties(child, {
pid: { value: 12345 },
exitCode: { get: () => exitCode },
stdout: { value: null, writable: true },
stderr: { value: null, writable: true },
});
return {
child,
@@ -46,7 +46,12 @@ it("cancels admission while Windows platform code loads without spawning or reta
it("preserves requested command inputs across Windows platform loading", async () => {
const root = dirs.make("managed-platform-inputs-");
const child = new ChildProcess();
Object.defineProperties(child, { pid: { value: 12345 }, exitCode: { value: 0 } });
Object.defineProperties(child, {
pid: { value: 12345 },
exitCode: { value: 0 },
stdout: { value: null, writable: true },
stderr: { value: null, writable: true },
});
let launched: { argument?: string; value?: string } | undefined;
mocks.spawnWindowsJobChild.mockImplementation((_command, args, options) => {
launched = { argument: args[0], value: options.env.VALUE };