| 30 | } |
| 31 | |
| 32 | class 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 | |
| 49 | const PROJECT = '/Users/me/project'; |
| 50 |
nothing calls this directly
no outgoing calls
no test coverage detected