I have read the documentation for vue-test-utils
and Jest, but I am still unsure about how to properly mock Vue mixins in a Vue component and test the component.
There are two ways:
localVue
class:const localVue = createLocalVue()
localVue.mixin(myMixin)
const wrapper = shallow(Post, {
localVue,
})
mixins
in the mounting options:const wrapper = shallow(Post, {
mixins: [myMixin],
})