fix(ci): repair main tsgo regressions

This commit is contained in:
Vincent Koc
2026-04-12 19:11:32 +01:00
parent c4412c6b0c
commit d4fb7d893d
5 changed files with 32 additions and 19 deletions

View File

@@ -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) {