forked from miriamgreis/vue-test-utils-vuetify-and-vuex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
37 lines (30 loc) · 939 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Import the mount() method from the test utils
// and the component you want to test
import { createLocalVue,shallowMount } from '@vue/test-utils'
import SimpleComponent from './SimpleComponent'
import Vuetify from 'vuetify'
const myPlugin = {
install: function(Vue, opts) {
Vue.mixin({
// this causes the problem
})
}
}
describe('SimpleComponent', () => {
it('example test with vuetify first', () => {
let localVue = createLocalVue()
localVue.use(Vuetify)
localVue.use(myPlugin)
const wrapper = shallowMount(SimpleComponent, {localVue})
console.log("-- Vuetify first --")
console.log(wrapper.html())
})
it('example test with vuetify second', () => {
let localVue = createLocalVue()
localVue.use(myPlugin)
localVue.use(Vuetify)
const wrapper = shallowMount(SimpleComponent, {localVue})
console.log("-- Vuetify second --")
console.log(wrapper.html())
})
})