Install @testing-library/vue
by default instead of @vue/test-utils
#6228
Labels
intend to implement
The team has the intention to implement this feature at some point. Contribution is also welcome.
scope: unit-jest
scope: unit-mocha
What problem does this feature solve?
In the official documentation on testing, the following is mentioned when suggesting the 2 libraries that can be used for testing:
The recommendation for new users is to use @testing-library/vue.
However,
@vue/cli-plugin-unit-jest
doesn't actually install@testing-library/vue
, but@vue/test-utils
I find it to be unintuitive that despite the recommendation, the more low-level (and "harder to use") alternative is installed by default.
It's probably not a good idea to install both by default, but if we have to pick one,
@testing-library/vue
seems like the obvious choice to me.The users who would be more likely to go with
@vue/test-utils
instead, are more likely to be more experienced, and will have a better understanding of the alternatives.What does the proposed API look like?
Change
vue-cli/packages/@vue/cli-plugin-unit-jest/generator/index.js
Line 15 in 82aef12
@testing-library/vue
insteadHappy to open a PR on this myself
The text was updated successfully, but these errors were encountered: