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
Documentation on how to use test-utils without babel/webpack #1192
Comments
You need to load the DOM before requiring
Likely Jest loads JSDOM in some script before Vue is required, which is why it works there. I am not entirely clear on why this the order makes a difference. |
It's actually not This fact should definitely be included in the documentation. test-utils could also check if jsdom was loaded and throw a more meaningful error if not. Thanks a lot! |
@aaronsum1102 thanks for raising this issue. Would you like to write the guide? |
I got same error.
My test got all green. |
if you do this, you can remove jsdom package from your package.json. |
I'm interested in writing a quick guide on how to use |
What problem does this feature solve?
The documentation explains how to use vue-test-utils with different runners and build setups but not how to test a plain component without babel / webpack. Since Vue itself works great without using single file components or a build step it would be great to provide at least one simple example on how to use vue-test-utils in that case.
I have tried some obvious ways and asked for help on the forum and SO more than two weeks ago but since no one could help this really seems to be not documented at all.
https://forum.vuejs.org/t/how-to-test-plain-vue-components-not-single-file-components/58415
https://stackoverflow.com/questions/55052983/how-to-test-plain-vue-components-not-single-file-components
What does the proposed API look like?
would be obvious but fails with this error:
The text was updated successfully, but these errors were encountered: