RenaiApp/mocks/electron.ts

26 lines
570 B
TypeScript

import WebContents = Electron.WebContents;
import path from 'path';
import { rewiremock } from './rewiremock';
const electronMock: DeepPartial<typeof Electron> = {
app: {
on(): void {},
getPath(name: string): string {
return path.resolve('test-paths', name);
},
quit(): void {},
},
BrowserWindow: class {
public webContents: DeepPartial<WebContents> = {
openDevTools(): void {},
};
public loadFile(): void {}
public on(): void {}
},
ipcMain: {
on(): void {},
},
};
rewiremock('electron').with(electronMock);