-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
In Cypress component testing, exposed values in a script setup
component are not accessible on the component instance (AKA wrapper.vm
)
#26575
Comments
@segevfiner This appears to be due to the older version of @lmiller1990 Can you confirm my hypothesis? The |
Sure, we should be able to bump to https://github.com/vuejs/test-utils/releases/tag/v2.3.2 without breaking. v2.4.0 has vuejs/test-utils#2026 which may permanent fix this need to constantly update types, but it might be a breaking change, so I'm not sure if we can adopt it yet. Edit... I tried dropping in Test Utils v2.3.2, I'm getting a bunch of typing errors that are very difficult to understand. I am wondering if we should just make |
Actually, I got the types to work. I see the value but I cannot access it: I think this is related to how we use a Proxy in cypress/vue, to wrap anothter proxy in Test Utils... eg here. Oddly enough, |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
In Cypress component testing, exposed values in a
script setup
component are not accessible on the component instance (AKAwrapper.vm
).This is available when using
@vue/test-utils
directly in vitest.Desired behavior
Exposed values from a
script setup
component are accessible.P.S. The type returned inside
Chainable
bymount
is not easily accessible as it is defined inline, which makes it hard to use via an alias (as
/get
). It might be nice to turn it into an exported interface for ease of use?Test code to reproduce
https://github.com/segevfiner/cypress-test-utils-expose-issue
Cypress Version
12.10.0
Node version
v16.20.0
Operating System
macOS 13.3.1
Debug Logs
cypress-debug.log
Other
The same kind of test works in
vitest
.The text was updated successfully, but these errors were encountered: