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:
parent
512237e047
commit
1aa1410b38
1 changed files with 5 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue