@@ -20,32 +20,35 @@ function render(
20
20
} = { } ,
21
21
configurationCb ,
22
22
) {
23
+ // TODO: Can we simplify this by using attachTo?
23
24
const div = document . createElement ( 'div' )
24
25
const baseElement = customBaseElement || customContainer || document . body
25
26
const container = customContainer || baseElement . appendChild ( div )
26
27
27
- const localVue = createLocalVue ( )
28
+ // const localVue = createLocalVue()
28
29
let vuexStore = null
29
30
let router = null
30
31
let additionalOptions = { }
31
32
33
+ // TODO: Fix VTL + Vuex (v4?)
32
34
if ( store ) {
33
35
const Vuex = require ( 'vuex' )
34
- localVue . use ( Vuex )
36
+ // localVue.use(Vuex)
35
37
vuexStore = new Vuex . Store ( store )
36
38
}
37
39
40
+ // TODO: Fix VTL + Vue-router(next?)
38
41
if ( routes ) {
39
42
const requiredRouter = require ( 'vue-router' )
40
43
const VueRouter = requiredRouter . default || requiredRouter
41
- localVue . use ( VueRouter )
44
+ // localVue.use(VueRouter)
42
45
router = new VueRouter ( {
43
46
routes,
44
47
} )
45
48
}
46
49
47
50
if ( configurationCb && typeof configurationCb === 'function' ) {
48
- additionalOptions = configurationCb ( localVue , vuexStore , router )
51
+ additionalOptions = configurationCb ( vuexStore , router )
49
52
}
50
53
51
54
if ( ! mountOptions . propsData && ! ! mountOptions . props ) {
@@ -54,11 +57,9 @@ function render(
54
57
}
55
58
56
59
const wrapper = mount ( TestComponent , {
57
- localVue,
58
- router,
59
- store : vuexStore ,
60
- attachToDocument : true ,
61
- sync : false ,
60
+ // router,
61
+ // store: vuexStore,
62
+ // attachToDocument: true,
62
63
...mountOptions ,
63
64
...additionalOptions ,
64
65
} )
@@ -71,10 +72,14 @@ function render(
71
72
baseElement,
72
73
debug : ( el = baseElement ) =>
73
74
Array . isArray ( el ) ? el . forEach ( e => logDOM ( e ) ) : logDOM ( el ) ,
74
- unmount : ( ) => wrapper . destroy ( ) ,
75
- isUnmounted : ( ) => wrapper . vm . _isDestroyed ,
75
+ unmount : ( ) => wrapper . unmount ( ) ,
76
+ // isUnmounted: () => wrapper.vm._isDestroyed,
76
77
html : ( ) => wrapper . html ( ) ,
77
78
emitted : ( ) => wrapper . emitted ( ) ,
79
+
80
+ // TODO: Is this unnecessary now? No need to await for a tick because
81
+ // setProps() handles it for us now.
82
+ // We can simply expose setProps.
78
83
updateProps : _ => {
79
84
wrapper . setProps ( _ )
80
85
return waitFor ( ( ) => { } )
0 commit comments