Skip to content

Commit a13e511

Browse files
author
Emmanouil Konstantinidis
committed
Mock electron's shell
1 parent 57d4fc5 commit a13e511

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
openExternal: jest.genMockFunction()
3+
};

src/js/__tests__/components/footer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ describe('Test for Footer', function () {
1313

1414
beforeEach(function () {
1515
// Mock Electron's window.require
16-
window.require = jest.genMockFunction();
16+
window.require = function () {
17+
return {
18+
require: jest.genMockFunction()
19+
};
20+
};
1721

1822
Actions = require('../../actions/actions.js');
1923
Footer = require('../../components/footer.js');

0 commit comments

Comments
 (0)