test(desktop-client/deepseek): mock electron ipcMain to unblock vitest import

The deepseek adapter pulls in electron/main when registering ipc listeners,
which made the test fail at import time outside the electron runtime. Stub
ipcMain with vi.mock so the unit test can load the module under vitest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 21:34:28 +08:00
parent 1ef7b872e3
commit 93cf734673
@@ -1,4 +1,10 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
vi.mock("electron/main", () => ({
ipcMain: {
on: vi.fn(),
},
}));
import { __deepseekTestUtils } from "./deepseek";
import { getMonitorAdapter } from "./index";