From 447165fba542e0c7d1f9ff730c4502aed9daefb9 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Mon, 8 Jul 2019 01:51:06 +0900
Subject: [PATCH] Use electrom-mock-ipc instead of electron-ipc-mock
---
package-lock.json | 17 +++++++++++++++++
package.json | 1 +
spec/mock/electron.ts | 9 +++++----
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 416cc85f..dc20fd6a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -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",
diff --git a/package.json b/package.json
index eb6239ef..625a958b 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/spec/mock/electron.ts b/spec/mock/electron.ts
index 5d3553b0..c8b57299 100644
--- a/spec/mock/electron.ts
+++ b/spec/mock/electron.ts
@@ -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 }