mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-29 17:19:00 +08:00
test(process): define synthetic child stdio state (#151096)
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user