()
| 28 | } |
| 29 | |
| 30 | function createMockBrowserWindow(): { |
| 31 | window: BrowserWindow; |
| 32 | sentEvents: Array<{ channel: string; data: unknown }>; |
| 33 | } { |
| 34 | const sentEvents: Array<{ channel: string; data: unknown }> = []; |
| 35 | |
| 36 | const mockWindow = { |
| 37 | webContents: { |
| 38 | send: (channel: string, data: unknown) => { |
| 39 | sentEvents.push({ channel, data }); |
| 40 | }, |
| 41 | openDevTools: () => { |
| 42 | throw new Error("openDevTools is not supported in headless mode"); |
| 43 | }, |
| 44 | } as unknown as WebContents, |
| 45 | isMinimized: () => false, |
| 46 | restore: () => undefined, |
| 47 | focus: () => undefined, |
| 48 | loadURL: () => { |
| 49 | throw new Error("loadURL should not be called in headless mode"); |
| 50 | }, |
| 51 | on: () => undefined, |
| 52 | setTitle: () => undefined, |
| 53 | } as unknown as BrowserWindow; |
| 54 | |
| 55 | return { window: mockWindow, sentEvents }; |
| 56 | } |
| 57 | |
| 58 | async function establishRootDir(providedRootDir?: string): Promise<{ |
| 59 | rootDir: string; |
no test coverage detected