1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-02-02 18:36:56 +01:00

Update jest version to 24.9.0 and fix some tests

This commit is contained in:
AkiraFukushima 2019-12-04 23:09:11 +09:00
parent ec9ce16c47
commit 6d59ea63e4
4 changed files with 694 additions and 870 deletions

1550
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -144,8 +144,7 @@
"moduleNameMapper": {
"@/router": "<rootDir>/spec/mock/router.ts",
"^@/(.+)": "<rootDir>/src/renderer/$1",
"^~/(.+)": "<rootDir>/$1",
"electron": "<rootDir>/spec/mock/electron.ts"
"^~/(.+)": "<rootDir>/$1"
},
"testMatch": [
"**/spec/**/*.spec.ts"
@ -263,7 +262,7 @@
"eslint-plugin-vue": "^5.2.2",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.5.0",
"jest": "^24.9.0",
"jsdom": "^15.2.1",
"json-loader": "^0.5.7",
"listr": "^0.14.3",

View File

@ -5,6 +5,11 @@ import { ManualProxy, ProxyProtocol } from '~/src/types/proxy'
const preferencesDBPath = path.resolve(__dirname, '../../preferences.json')
const proxyConfiguration = new ProxyConfiguration(preferencesDBPath)
// electron.app is using in electron-json-storage
jest.mock('electron', () => ({
app: jest.fn()
}))
describe('Parser', () => {
it('do not use proxy', () => {
proxyConfiguration.setSystemProxy('DIRECT')

View File

@ -1,6 +1,6 @@
import { createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'
import { ipcMain } from '~/spec/mock/electron'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import App from '@/store/App'
import DisplayStyle from '~/src/constants/displayStyle'
import { LightTheme, DarkTheme } from '~/src/constants/themeColor'
@ -8,6 +8,8 @@ import Theme from '~/src/constants/theme'
import TimeFormat from '~/src/constants/timeFormat'
import Language from '~/src/constants/language'
import DefaultFonts from '@/utils/fonts'
import { MyWindow } from '~/src/types/global'
;(window as MyWindow).ipcRenderer = ipcRenderer
const state = () => {
return {