-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Changed recommendation for testing library #2306
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
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much personal experience of working with either library, so I'm not really able to judge what the recommendation should be.
As Suspense is still considered experimental, I'm not sure whether @testing-library/vue
should be expected to have proper support for it.
src/guide/scaling-up/testing.md
Outdated
cy.get(valueSelector) | ||
.should('be.visible') | ||
.and('contain.text', '0') | ||
.get(buttonSelector) | ||
.click() | ||
.get(valueSelector) | ||
.should('contain.text', '1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these formatting changes intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was autoformatter. Removed the changes.
src/guide/scaling-up/testing.md
Outdated
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. | ||
- [`@testing-library/vue`](https://github.com/testing-library/vue-testing-library) is a Vue testing library focused on testing components without relying on implementation details. Built with accessibility in mind, its approach also makes refactoring a breeze. Its guiding principle is that the more tests resemble the way software is used, the more confidence they can provide. | ||
|
||
We recommend using `@vue/test-utils` for testing components in applications, as its focus aligns better with the testing priorities of applications. `@testing-library/vue` has issues with testing asynchronous component with Suspense, so it should be used with caution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bit about how 'its focus aligns better with the testing priorities of applications' seemed specific to @testing-library/vue
. Does it still make sense to have that comparison when switching the recommendation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I've removed this bit
@skirtles-code thank you for the review! I've addressed your comments, could you please take another look? |
@NataliaTepluhina It may make sense to update the |
Description of Problem
As described in #2295, vue-testing-library has issued with testing async components with Suspense. We cannot recommend it over Vue Test Utils that deal with Suspense fine
Proposed Solution
Recommend VTU over testing library
Additional Information
Close #2295