-
Notifications
You must be signed in to change notification settings - Fork 245
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
Bug: Cannot acess global plugin in test file (wrapper.vm.$plugin) #2298
Comments
Hi @ElVisPL Interesting, because we have a similar test case in this repo https://github.com/vuejs/test-utils/blob/main/tests/config.spec.ts Do you think you could look into it and open a PR? We would gladly review it and merge it. The test file I mentioned is a good place to try to add your repro and see if you still reproduce the issue. |
@cexbrayat |
@taku-y-9308 Maybe it does, I'm not sure. We'll check when the new version is released 👍 |
I think @taku-y-9308 did fix the issue: if I update to v2.4.6 in @ElVisPL 's stacklitz repro, the Let's close the issue, and thanks @taku-y-9308 for solving this. |
Describe the bug
I'm migrating vue2 to vue3 (test utils too)
In vue2 if I had global plugin that was installed with
createLocalVue
then it was accessible underwrapper.vm
(e.gwrapper.vm.$logger
), in vue3 if i pass plugin toglobal.plugins
then it is passed correctly to tested component, but in the test itself I don't have access to it so e.g I can't mock itIt works though for external provider plugins like vuetify (
wrapper.vm.$vuetify
is there)To Reproduce
https://stackblitz.com/edit/github-guxdre-g64fcl?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts
In test file see console.log
Expected behavior
Global plugin is accessible e.g
wrapper.vm.$logger
The text was updated successfully, but these errors were encountered: