mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:10:58 +00:00
fix(ci): repair main tsgo regressions
This commit is contained in:
@@ -39,15 +39,16 @@ interface MockChild extends EventEmitter {
|
||||
function createMockChild(params?: { autoClose?: boolean; closeDelayMs?: number }): MockChild {
|
||||
const stdout = new EventEmitter();
|
||||
const stderr = new EventEmitter();
|
||||
const child = new EventEmitter();
|
||||
child.stdout = stdout;
|
||||
child.stderr = stderr;
|
||||
child.closeWith = (code = 0) => {
|
||||
child.emit("close", code);
|
||||
};
|
||||
child.kill = () => {
|
||||
// Let timeout rejection win in tests that simulate hung QMD commands.
|
||||
};
|
||||
const child: MockChild = Object.assign(new EventEmitter(), {
|
||||
stdout,
|
||||
stderr,
|
||||
closeWith: (code: number | null = 0) => {
|
||||
child.emit("close", code);
|
||||
},
|
||||
kill: () => {
|
||||
// Let timeout rejection win in tests that simulate hung QMD commands.
|
||||
},
|
||||
});
|
||||
if (params?.autoClose !== false) {
|
||||
const delayMs = params?.closeDelayMs ?? 0;
|
||||
if (delayMs <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user