MCPcopy Index your code
hub / github.com/coder/mux / createMockBrowserWindow

Function createMockBrowserWindow

tests/ipc/setup.ts:35–51  ·  view source on GitHub ↗

* Create a mock BrowserWindow for tests. * Note: Events are now consumed via ORPC subscriptions (StreamCollector), * not via windowService.send(). This mock just satisfies the window service API.

()

Source from the content-addressed store, hash-verified

33 * not via windowService.send(). This mock just satisfies the window service API.
34 */
35function createMockBrowserWindow(): BrowserWindow {
36 const mockWindow = {
37 webContents: {
38 send: jest.fn(),
39 openDevTools: jest.fn(),
40 } as unknown as WebContents,
41 isDestroyed: jest.fn(() => false),
42 isMinimized: jest.fn(() => false),
43 restore: jest.fn(),
44 focus: jest.fn(),
45 loadURL: jest.fn(),
46 on: jest.fn(),
47 setTitle: jest.fn(),
48 } as unknown as BrowserWindow;
49
50 return mockWindow;
51}
52
53/**
54 * Create a test environment with temporary config and service container

Callers 1

createTestEnvironmentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected