Skip to content

Commit

Permalink
Merge pull request #1553 from ubports/tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
NeoTheThird committed Nov 19, 2020
2 parents 24050ee + 8f0e40f commit 316940a
Show file tree
Hide file tree
Showing 19 changed files with 15,529 additions and 11,555 deletions.
16 changes: 16 additions & 0 deletions __mocks__/electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const electron = {
app: {
on: jest.fn(),
getPath: jest.fn(),
getVersion: jest.fn()
},
BrowserWindow: jest.fn(),
ipcMain: {
on: jest.fn(),
handle: jest.fn()
},
shell: jest.fn(),
Menu: jest.fn()
};

module.exports = electron;
19 changes: 19 additions & 0 deletions __mocks__/winston.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const logger = {
addColors: jest.fn(),
format: {
combine: jest.fn(),
colorize: jest.fn(),
simple: jest.fn(),
json: jest.fn()
},
transports: {
Console: jest.fn(),
File: jest.fn()
},
createLogger: jest.fn().mockImplementation(() => ({
query: jest.fn(),
log: jest.fn()
}))
};

module.exports = logger;
Loading

0 comments on commit 316940a

Please sign in to comment.