Merge pull request #953 from h3poteto/mock

Use electrom-mock-ipc instead of electron-ipc-mock
This commit is contained in:
AkiraFukushima 2019-07-08 08:53:04 +09:00 committed by GitHub
commit 02cdb0cf78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

17
package-lock.json generated
View File

@ -6725,6 +6725,23 @@
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-2.2.17.tgz",
"integrity": "sha512-v+Af5W5z99ehhaLOfE9eTSXUwjzh2wFlQjz51dvkZ6ZIrET6OB/zAZPvsuwT6tm3t5x+M1r+Ed3U3xtPZYAyuQ=="
},
"electron-mock-ipc": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/electron-mock-ipc/-/electron-mock-ipc-0.1.3.tgz",
"integrity": "sha512-+x5v+hmZZYUi8SMJNBtcq1o2p3aUJfT3aJCEKIoajSa/6rV9EdmFOd/rHLVEH85GSlWQCf+i1yV4r4bDnfEXHw==",
"dev": true,
"requires": {
"typescript": "^3.5.2"
},
"dependencies": {
"typescript": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz",
"integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==",
"dev": true
}
}
},
"electron-osx-sign": {
"version": "0.4.10",
"resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz",

View File

@ -235,6 +235,7 @@
"electron-debug": "^2.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-ipc-mock": "0.0.3",
"electron-mock-ipc": "^0.1.3",
"electron-packager": "^12.2.0",
"eslint": "^5.9.0",
"eslint-config-prettier": "^4.1.0",

View File

@ -1,6 +1,7 @@
import mock from 'electron-ipc-mock'
import createIPCMock from 'electron-mock-ipc'
const mocked = createIPCMock()
const ipcMain = mocked.ipcMain
const ipcRenderer = mocked.ipcRenderer
const instance = mock()
const ipcMain = instance.ipcMain
const ipcRenderer = instance.ipcRenderer
export { ipcMain, ipcRenderer }