Skip to content
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

Not able to serialize Vue 3 component #81

Open
kepi0809 opened this issue Jan 31, 2022 · 6 comments
Open

Not able to serialize Vue 3 component #81

kepi0809 opened this issue Jan 31, 2022 · 6 comments

Comments

@kepi0809
Copy link

I have the same error with this package as described here eddyerburgh#49

@kepi0809
Copy link
Author

found a solution for this, needed to make .html() in the expect in every case, so only the syntactic sugar is broken. Perhaps this is worth to mention in the migration guide.

@Knogobert
Copy link

.element seems to work as well, giving a less prettified/minified output

@mikemklee
Copy link

Any updates on this?

@TheJaredWilcurt
Copy link
Member

#64

@TheJaredWilcurt
Copy link
Member

TheJaredWilcurt commented Jun 2, 2023

Just for others to reference. This is how I'm using this library in a Vue 3 project. I've created a custom serializer for that project, then passing data into this library. Works for Jest or Vitest.

Works with defaults. Just be aware that not all features that worked on Vue 2 are available on Vue 3, you may need to do:

-expect(wrapper)
+expect(wrapper.html())
   .toMatchSnapshot();

in some places if upgrading from Vue 2 to Vue 3.

@TheJaredWilcurt
Copy link
Member

@kepi0809 @Knogobert @mikemklee

This is a Vue 2 + Jest + CJS library. I'm almost done with a total re-write to Vue 3 + Vitest (and Jest) + ESM. If you want to test it out early:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants