Vue Unit Test: provide injection variable not found

dzxyshuo 注册会员
2023-01-25 04:47

With Vue 3 options API it seems that you need to specify the provide option globally. Though, i cannot find that in documentation Thereafter it seems that you need to provide the service as an attribute, rather than a method. Cannot find that either in any on-line documentation...

const wrapper = mount(Navbar, {
      global: {
        provide: {
          "emitter": emit;
        props: {
          isHome: true,

About the Author

Question Info

Publish Time
2023-01-25 04:47
Update Time
2023-01-25 04:47

Related Question