How to unit testing with jest in vue composition api component?

后端 未结 1 655
北荒
北荒 2021-02-07 14:23

I\'m writing a unit test with jest, for my composition API component in vue.js.

But I can\'t access to functions in composition API\'s setup().

Indicator

1条回答
  •  终归单人心
    2021-02-07 14:38

    I think simply importing CompositionApi should solve your issue.

    import CompositionApi from '@vue/composition-api'
    
    Vue.use(CompositionApi)
    

    0 讨论(0)
提交回复
热议问题