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.
This commit is contained in:
iliya 2026-02-24 14:30:17 +02:00 committed by Илия
parent 512237e047
commit 1aa1410b38

View file

@ -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',