forked from vuejs/vue-test-utils-getting-started
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
26 lines (20 loc) · 863 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
import { createLocalVue,shallowMount } from '@vue/test-utils'
import Component from './components/component'
import SubComponent from './components/subcomponent'
import exampleMixin from './components/exampleMixin'
describe('Component', () => {
it('shallowMount component and try to get property of mixin', () => {
const wrapper = shallowMount(Component);
let subcomponent = wrapper.find(SubComponent);
console.log(subcomponent.props());
console.log(subcomponent.attributes());
})
it('shallowMount component and try to get property of mixin with global mixin', () => {
const localVue = createLocalVue()
localVue.mixin(exampleMixin)
const wrapper = shallowMount(Component, {localVue})
let subcomponent = wrapper.find(SubComponent)
console.log(subcomponent.props())
console.log(subcomponent.attributes())
})
})