feat(plugin): support enterprise extension (#861)
This commit is contained in:
@@ -5,6 +5,30 @@
|
||||
import { vi } from 'vitest';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// Provide a minimal `electron` mock so tests that transitively import
|
||||
// main-process code (logger, store, etc.) don't blow up when the Electron
|
||||
// binary is not present (e.g. CI with ELECTRON_SKIP_BINARY_DOWNLOAD=1).
|
||||
// Individual test files can override with their own vi.mock('electron', ...).
|
||||
vi.mock('electron', () => ({
|
||||
app: {
|
||||
getPath: vi.fn().mockReturnValue('/tmp/clawx-test'),
|
||||
getVersion: vi.fn().mockReturnValue('0.0.0-test'),
|
||||
getName: vi.fn().mockReturnValue('clawx-test'),
|
||||
isPackaged: false,
|
||||
isReady: vi.fn().mockResolvedValue(true),
|
||||
on: vi.fn(),
|
||||
off: vi.fn(),
|
||||
quit: vi.fn(),
|
||||
whenReady: vi.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
BrowserWindow: vi.fn(),
|
||||
ipcMain: { on: vi.fn(), handle: vi.fn(), removeHandler: vi.fn() },
|
||||
dialog: { showOpenDialog: vi.fn(), showMessageBox: vi.fn() },
|
||||
shell: { openExternal: vi.fn() },
|
||||
session: { defaultSession: { webRequest: { onBeforeSendHeaders: vi.fn() } } },
|
||||
utilityProcess: {},
|
||||
}));
|
||||
|
||||
// Mock window.electron API
|
||||
const mockElectron = {
|
||||
ipcRenderer: {
|
||||
|
||||
Reference in New Issue
Block a user