New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: wrapper.vm does not contain props when using script setup syntax with Vue 3.2.45 and VTU 2.2.2 #1863
Labels
bug
Something isn't working
Comments
cexbrayat
added a commit
to cexbrayat/vue-test-utils-next
that referenced
this issue
Nov 14, 2022
Fixes vuejs#1863 It turns out `vm` is not enough, and we need to proxy to `vm.$.ctx` which contains the props as well.
cexbrayat
added a commit
to cexbrayat/vue-test-utils-next
that referenced
this issue
Nov 14, 2022
Fixes vuejs#1863 It turns out `vm` is not enough, and we need to proxy to `vm.$.ctx` which contains the props as well.
cexbrayat
added a commit
to cexbrayat/vue-test-utils-next
that referenced
this issue
Nov 14, 2022
Fixes vuejs#1863 It turns out `vm` is not enough, and we need to proxy to `vm.$.ctx` which contains the props as well.
@misaacs21 Thanks for the repro 👍 I think I have a fix for this, see #1864 |
cexbrayat
added a commit
to cexbrayat/vue-test-utils-next
that referenced
this issue
Nov 15, 2022
Fixes vuejs#1863 It turns out `vm` is not enough, and we need to proxy to `vm.$.ctx` which contains the props as well.
cexbrayat
added a commit
that referenced
this issue
Nov 15, 2022
Fixes #1863 It turns out `vm` is not enough, and we need to proxy to `vm.$.ctx` which contains the props as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When upgrading to Vue 3.2.45 and VTU 2.2.2, wrapper props are not available via
wrapper.vm
as they used to be, and all returnundefined
when accessed. They are available onwrapper.vm.$.props
, however.To Reproduce
Reproduction: https://stackblitz.com/edit/vitest-dev-vitest-unycdj?file=test/basic.test.js
This same setup passes on previous versions.
Expected behavior
Props should be accessible via
wrapper.vm
when using script setup as they were in previous versions, and tests in the reproduction should pass.Related information:
@vue/test-utils
version: 2.2.2Vue
version: 3.2.45node
version: 16.14.2npm
version: 7.17.0The text was updated successfully, but these errors were encountered: