-
Notifications
You must be signed in to change notification settings - Fork 257
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: _ctx is missing functions that are returned from the setup functions #1870
Comments
Hi @sevilyilmaz Can you provide us a small repro online using https://stackblitz.com/edit/vitest-dev-vitest-qoiwy3?file=package.json&initialPath=__vitest__ ? |
Hi @cexbrayat |
👍 thanks @xanf What do you think we should do in that case? |
@cexbrayat let me investigate that |
Hey, had the same issue since yesterday. Got a minimal example repo to reproduce it. Have a look at the README and he commit history to reproduce the error and potentially fixes. However, we got those errors since Edit: Maybe this post is more related with #1869 |
I have encountered this same issue with version |
@stephan-roolvink @Theiaz Yes, you are probably encountering #1869 We already have a fix, we just need to merge and release it. |
#1869 is out, can anyone encountering this issue try updating to 2.2.4 and see if that fixes it? |
@lmiller1990 I still have the error after bumping up to 2.2.4. Here is the updated repro link if it helps |
The fix is working at my example repo. |
@Theiaz 👍 The issue @sevilyilmaz has is another one, and we need @xanf feedback |
Yeah, I'm still looking if we could fix it in vue core, because I'm still looking for non-ugly workaround in VTU |
we still have the same error. downgrading to 2.2.2 fixes it immediately... using a combination of options api and composition api in our project. and since 2.2.3 we get this problem: global mocks just disappear (in our case, we 'enhanced' the mount/shallowMount with mocks for all vue-i18n methods, so all our mount/shallowMount have this mocked vue-i18n methods, even adding a mocked $router just ... disappears...) |
We are still investigating some strange behaviour together with setup-option and vue router (nested routing). Tests keeps failing, only rollback to 2.2.2 solves it. I created an example repository on stackblitz.
|
Are there any updates? I'm kind of stuck to |
Did we ever isolate the commit that broke this? That'd be the first step to finding a fix. |
FYI I have the same issue except with $setup.t, using script setup and vitest. |
I have this issue too ( |
I have the same issue with It seems that my issue only happens when
|
I have this issue too, had to downgrade to 2.2.1 to get test utils to find my computed functions. |
Hi,
I started getting the error below after upgrading from
2.2.1
to2.2.2
.Describe the bug
I do slot validations in the
setup
function, sometimes to hide certain HTML elements and sometimes for their content. I created a helper to capture the errors.I write the tests like this:
When I upgraded to
2.2.2
I started getting the error above. It seems the functions that I use in the template are not being populated from thesetup
function.I assume the problem that I'm having is related to this change 74c9af4
To Reproduce
Expected behavior
The component should be able to use the functions that are returned from the
setup
function.Related information:
@vue/test-utils
version:2.2.2
Vue
version:3.2.45
node
version:16.17.0
npm
(oryarn
) version:yarn v1.22.17
Additional context
The text was updated successfully, but these errors were encountered: