Skip to content

Commit ccf75e1

Browse files
committed
Remove hard dependencies on vue-router and vuex
1 parent 295c870 commit ccf75e1

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

package-lock.json

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
"dom-testing-library": "^1.0.0",
2929
"@vue/test-utils": "^1.0.0-beta.12",
3030
"vue": "^2.5.16",
31-
"vue-router": "^3.0.1",
32-
"vue-template-compiler": "^2.5.16",
33-
"vuex": "^3.0.1"
31+
"vue-template-compiler": "^2.5.16"
3432
},
3533
"devDependencies": {
3634
"axios": "^0.18.0",
@@ -46,7 +44,9 @@
4644
"jest-in-case": "^1.0.2",
4745
"jest-serializer-vue": "^1.0.0",
4846
"vee-validate": "^2.0.6",
49-
"vue-jest": "^2.2.1"
47+
"vue-router": "^3.0.1",
48+
"vue-jest": "^2.2.1",
49+
"vuex": "^3.0.1"
5050
},
5151
"jest": {
5252
"moduleDirectories": [

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { createLocalVue, mount, Wrapper } from '@vue/test-utils'
2-
import Vuex from 'vuex'
3-
import VueRouter from 'vue-router'
42
import Simulate from './Simulate'
53
import { wait, queries } from 'dom-testing-library'
64

@@ -10,11 +8,13 @@ function render(TestComponent, { props = null, store = null, routes = null } = {
108
let router = null
119

1210
if (store) {
11+
const Vuex = require('vuex')
1312
localVue.use(Vuex)
1413
vuexStore = new Vuex.Store(store)
1514
}
1615

1716
if (routes) {
17+
const VueRouter = require('vue-router')
1818
localVue.use(VueRouter)
1919
router = new VueRouter(routes)
2020
}

0 commit comments

Comments
 (0)