-
Notifications
You must be signed in to change notification settings - Fork 111
Vue testing library depends on vuex and vue-router types #187
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
Comments
Hi! Yes it does, because VTL accepts a I once thought that they should be listed as peerDeps, but since they are only required if these keys are there… |
I've double checked and no I've bypassed the issue by requiring both packages in order to use VTL. I believe it should be optional, and currently it isn't. Don't know how to solve it... =( |
Hm, can you share the test that makes both deps fail? |
Hi! I think I've run into this issue as well. I get
in a ts project that does not have a dependency on vuex. It builds if I add vuex as dep. |
Having similtar issue with vue-router. The project doesnt have a dependency on it, still the following error happens on build:
|
I just added vue-router as a development dependency and the build went fine. |
Looks like it is due to VTL types making use of TS definitions from both Router and Vuex. Not sure how to fix this one – maybe simply copy&pasting these types from both libraries into VTL, so that the dependency can go? https://github.com/testing-library/vue-testing-library/blob/master/types/index.d.ts#L3-L6 |
Took a look, and types we're getting from Vuex and Vue Router are quite complex and verbose. We'd be copy&pasting a huge chunk of Router/Vuex types… not entirely sure this is benefitial over installing two deps (that could be defined as thoughts? |
I'm not sure If all types are needed, we might add a few to stop the error and that's It. But I'm not sure, as far as I see VTL shouldn't rely on those types in any way. |
Wouldn't that generate several warnings on loose types if we change the complex ones to
Would you define |
Is there a best way? I really don't want to copy and maintain a ton of Router/Vuex types, and loosen them up doesn't feel right, either: #246 |
I use
I installed vuex and vue-router as devDependencies and the error was fixed. Although PR was already merged, I'm not sure why this still happens. |
Hi there! For my surprise importing the
@testing-library/vue
module raises a compilation error due to a dependency withvue-router
andvuex
.I've tried installing both dependencies and test pass, but I believe it shouldn't be mandatory in order to run tests, right?
Notice: I'm not using Jest. I'm running tests with Mocha.
The text was updated successfully, but these errors were encountered: