Method one:
const mixin = {
beforeCreate() {
// do something
}
}
mount(TestComponent, {
mixins: [mixin]
})
and method two:
const mixin = {
beforeCreate() {
// do something
}
}
localVue = createLocalVue()
localVue.mixin(mixin)
mount(TestComponent, {
localVue
})
both methods not work for me. I get an error: 'Cannot read property 'props' of undefined' on development environment and on CodeSandbox. https://codesandbox.io/s/4031x2r769
How to correctly mock lifecycle hooks?