1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/__mocks__/electron.ts
Hung-Han (Henry) Chen 7a2da15828
Mock electron.ipcRenderer.on to prevent errors in React compoment test cases
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
2020-11-03 18:26:17 +08:00

21 lines
367 B
TypeScript

module.exports = {
require: jest.fn(),
match: jest.fn(),
app: {
getVersion: jest.fn().mockReturnValue("3.0.0"),
getLocale: jest.fn().mockRejectedValue("en"),
getPath: jest.fn((name: string) => {
return "tmp"
}),
},
remote: {
app: {
getPath: jest.fn()
}
},
dialog: jest.fn(),
ipcRenderer: {
on: jest.fn()
}
};