From 21cebae1177b942a6b111b3b7caebf2989e773e0 Mon Sep 17 00:00:00 2001 From: iliya Date: Tue, 24 Feb 2026 14:30:17 +0200 Subject: [PATCH] fix: add electron mock to teams IPC test for CI compatibility The test imports teams.ts which transitively requires electron runtime (via NotificationManager). Add vi.mock('electron') so tests pass in CI where electron binary is not installed. --- test/main/ipc/teams.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/main/ipc/teams.test.ts b/test/main/ipc/teams.test.ts index e9ad20b3..2599a2f4 100644 --- a/test/main/ipc/teams.test.ts +++ b/test/main/ipc/teams.test.ts @@ -1,6 +1,11 @@ import * as os from 'os'; import { beforeEach, describe, expect, it, vi } from 'vitest'; +vi.mock('electron', () => ({ + app: { getLocale: vi.fn(() => 'en'), getPath: vi.fn(() => '/tmp') }, + Notification: vi.fn(), +})); + vi.mock('@preload/constants/ipcChannels', () => ({ TEAM_LIST: 'team:list', TEAM_GET_DATA: 'team:getData',