Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import { ErrorHandler } from "./react/components/common/errorHandler/errorHandle
describe("App Component", () => {
const defaultState: IApplicationState = initialState;
const store = createReduxStore(defaultState);
const electronMock = {
ipcRenderer: {
send: jest.fn(),
on: jest.fn(),
},
};

beforeAll(() => {
delete (window as any).require;
});

function createComponent() {
return mount(
Expand Down
10 changes: 9 additions & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });
// Silence console.log and console.group statements in testing
console.log = console.group = function() {};
console.log = console.group = function() {};
const electronMock = {
ipcRenderer: {
send: jest.fn(),
on: jest.fn(),
},
};

window.require = jest.fn(() => electronMock);