mock electron log in all tests

This commit is contained in:
Vishwas Shashidhar 2020-09-25 15:16:33 +05:30
parent 1a77cb0e90
commit 42edc38413
2 changed files with 35 additions and 3 deletions

View File

@ -18,6 +18,8 @@ const getMainWindow = {
setFullScreenable: jest.fn(), setFullScreenable: jest.fn(),
}; };
jest.mock('electron-log');
jest.mock('../src/common/env', () => { jest.mock('../src/common/env', () => {
return { return {
isWindowsOS: true, isWindowsOS: true,
@ -52,6 +54,20 @@ jest.mock('../src/app/window-actions', () => {
}; };
}); });
jest.mock('../src/common/logger', () => {
return {
logger: {
setLoggerWindow: jest.fn(),
error: jest.fn(),
warn: jest.fn(),
info: jest.fn(),
verbose: jest.fn(),
debug: jest.fn(),
silly: jest.fn(),
},
};
});
describe('child window handle', () => { describe('child window handle', () => {
const frameName = {}; const frameName = {};
const disposition = 'new-window'; const disposition = 'new-window';

View File

@ -1,3 +1,5 @@
jest.mock('electron-log');
jest.mock('../src/app/window-actions', () => { jest.mock('../src/app/window-actions', () => {
return { return {
activate: jest.fn(), activate: jest.fn(),
@ -18,6 +20,20 @@ jest.mock('../src/common/env', () => {
}; };
}); });
jest.mock('../src/common/logger', () => {
return {
logger: {
setLoggerWindow: jest.fn(),
error: jest.fn(),
warn: jest.fn(),
info: jest.fn(),
verbose: jest.fn(),
debug: jest.fn(),
silly: jest.fn(),
},
};
});
describe('protocol handler', () => { describe('protocol handler', () => {
let protocolHandlerInstance; let protocolHandlerInstance;