[Vuejs]-VueJS Default props factory function and test coverage

7👍

I was trying to find an answer for a simular issue I was having with my test coverage, I couldn’t get 100% of tests covered coz the default function should be tested. Couldn’t find anything on SO.

After some tryings I got to a solution on how to test the default. Not sure if would help you, but solved my case:

expect(wrapper.vm.$options.props.myObjectProp.default.call()).toEqual([])

expect(wrapper.vm.$options.props.myArrayProp.default.call()).toEqual([])

Leave a comment