Open gsamal opened 4 months ago
Hi @gsamal
If you are still encountering this issue, can you provide us a small repro online using https://stackblitz.com/github/vuejs/create-vue-templates/tree/main/typescript-vitest?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts ?
It only takes a few minutes, and we'll be able to take a look
@cexbrayat here is the link to reproduce - https://stackblitz.com/edit/github-g3hyfh?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts
Do note that the tests are passing but the last two consoles are not as expected. From
wrapper.vm.downloadAsImage(); // Points to the original import - Should be pointing to the mocked mixin???
widgetExportAsImageWrapper.vm.downloadAsImage(); // Points to the mocked mixin
Describe the bug
I am trying to mock the mixins used in the Vue component by passing in a fake mixin under
global.mixins
. But it seems to be not working on the Component while on the child component I can see the mocked method.No difference on switching from
shallowMount
tomount
.To Reproduce
common-chart.vue
chart-mixin.vue
test.spec.js
Test output
Expected behavior
wrapper.vm.downloadAsImage()
should call to the mocked mixins method when invoked.Related information: