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

Class FakeWindow

packages/desktop/tests/main/terminal-lifecycle.test.ts:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32class FakeWindow implements ClosableWindow {
33 private readonly closedCbs: Array<() => void> = [];
34 private destroyed = false;
35 constructor(private readonly _id: number) {}
36 get id(): number {
37 if (this.destroyed) throw new Error('Object has been destroyed');
38 return this._id;
39 }
40 on(event: 'closed', cb: () => void): void {
41 if (event === 'closed') this.closedCbs.push(cb);
42 }
43 close(): void {
44 this.destroyed = true;
45 for (const cb of this.closedCbs) cb();
46 }
47}
48
49const PROJECT = '/Users/me/project';
50

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected