Bug: findComponent
doesn't not return exposed properties in vm if component is bundled
#2591
Labels
bug
Something isn't working
Describe the bug
This is a bit hard to describe but hopefully the reproduction demo will clear things up.
I have a big project with 7000+ thousand tests. Recent ones are good, old ones are bad and rely heavily on
.vm
.I'm migrating the code base to a monorepo and the design system is now bundled as separate package by
vite
and the apps import the components’ bundled version instead of the.vue
, tests inherently do too. I noticed that most of the tests that rely onvm
stopped working.Note
I don't know if this is
VTU
fault or if it's by design, but having in mind that if I import the raw.vue
component instead of the bundled.js
version everything works I am assuming it is — Please close this issue if my assumption is wrong.To Reproduce
https://stackblitz.com/edit/vitest-dev-vitest-h8drorow?file=apps%2Fdemo%2Ftest%2Fbasic.test.ts
Should run automatically, if not
npm run test
Expected behavior
exposed properties via
defineExpose
are available though offindComponent
returnedVueWrapper
Assuming a basic
VExample.vue
componentBundles to
Faulty test
Related information:
Additional context
The same behaviour is not found in
mount
. When passing the bundled version of a component tomount
, exposed properties are exposed correctly to vm, that's why I think it's a bug infindComponent
.The text was updated successfully, but these errors were encountered: