-
Notifications
You must be signed in to change notification settings - Fork 434
Data not defined on instance in unit test Vue 3 #524
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
Comments
Ok, nobody does unit tests in combination with class components? I also ran into another issue with Vue-class-components in another library. Maybe that is related? quasarframework/quasar#8915 (comment) Before with class components the options were besides the |
Ok, it seems importing Vue from |
I got similar issue when I try to write unit tests for my class-style code using vue-test-utils. You would find that when you use |
Created an issue on vue-test-utils about this: vuejs/test-utils#544 (comment) Although the issue seems to be originating from |
Hi there!
I started with migrating our codebase from Vue 2 with class components to Vue 3. The project doesn't run yet with Vue 3 but I'm already looking at our unit tests to see if I can get a setup with
jest
andvue-test-utils
working. I'm running in a strange issue however, not sure how to proceed.I have the following minimal component:
And I created a unit test for that (file
DefaultComponent.spec.ts
):The
createWrapper
is a custom function in which I do some general setup and eventually do areturn mount(DefaultComponent, {...options})
. I have the following packages installed:When I run this test it gives the following output:
Anyone have any idea why this is happening? If anyone has unit tests with class components working I would very much love some examples, because my search so far is turning up empty.
Thanks!
The text was updated successfully, but these errors were encountered: