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

revisit testing-library recommendation? #2295

Closed
gurgeous opened this issue Mar 21, 2023 · 2 comments · Fixed by #2306
Closed

revisit testing-library recommendation? #2295

gurgeous opened this issue Mar 21, 2023 · 2 comments · Fixed by #2306
Assignees

Comments

@gurgeous
Copy link

Hi guys. We were adding tests to our vue app and we read this recommendation:

We recommend using @testing-library/vue for testing components in applications, as its focus aligns better with the testing priorities of applications. Use @vue/test-utils only if you are building advanced components that require testing Vue-specific internals.

Unfortunately, we discovered that testing-library doesn't work with basic vue3 features like async setup/. Getting anything to work requires massive amounts of research and obscure workarounds (see testing-library/vue-testing-library#230 and https://gist.github.com/sand4rt/5da4dda9b1aec636c92b83b83cc95aee.

Now that this use case is reasonably well supported by the latest version of test-utils, do we want to revisit this recommendation? I think this paragraph was written with the best of intentions years ago, but may no longer be accurate. I feel a bit misled and maybe we can prevent others from going through that experience.

@NataliaTepluhina
Copy link
Member

@gurgeous this is a really good suggestion. I prefer VTU over testing-library myself, and it seems the fix for async+suspense in testing library is long due. I'll look into rewriting this recommendation (unless you would like to create a PR yourself 😅 )

@gurgeous
Copy link
Author

This is great, thank you! Your work is appreciated :)

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

Successfully merging a pull request may close this issue.

2 participants