Skip to content

Bug: Cannot acess global plugin in test file (wrapper.vm.$plugin) #2298

Closed
@ElVisPL

Description

@ElVisPL

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 under wrapper.vm (e.g wrapper.vm.$logger), in vue3 if i pass plugin to global.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 it

It 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions