MCPcopy
hub / github.com/inkeep/open-knowledge / FakeReapProcess

Class FakeReapProcess

packages/desktop/tests/utility/pty-host.test.ts:589–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587});
588
589class FakeReapProcess implements HostReapProcess {
590 exitCodes: number[] = [];
591 private readonly listeners = new Map<string, Array<() => void>>();
592 on(event: 'exit' | NodeJS.Signals, listener: () => void): void {
593 const arr = this.listeners.get(event) ?? [];
594 arr.push(listener);
595 this.listeners.set(event, arr);
596 }
597 exit(code?: number): void {
598 this.exitCodes.push(code ?? 0);
599 }
600 emit(event: 'exit' | NodeJS.Signals): void {
601 for (const listener of this.listeners.get(event) ?? []) listener();
602 }
603}
604
605function makeReapHandle(): { handle: PtyHostHandle; killCount: () => number } {
606 let count = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected