import { describe, it, expect, vi } from 'vitest' const { setMainWindow, sendToRenderer } = await import('../../src/main/windowBridge') describe('sendToRenderer()', () => { it('should do nothing when no main window has been set', () => { expect(() => sendToRenderer('some-channel', 1, 2)).not.toThrow() }) it('should forward the channel and args to the main window webContents', () => { const send = vi.fn() setMainWindow({ webContents: { send } } as never) sendToRenderer('some-channel', 'a', 'b') expect(send).toHaveBeenCalledWith('some-channel', 'a', 'b') }) })