I'm trying to test the following prop in vue.js with jest:
export default {
name: 'my-component',
props: {
onConfirm: {
type: Function,
default: () => {}
},
}
}
Jest keeps telling my that I need to cover default value of the onConfirm prop, but I have no clue how to.
I've tried the following:
expect(wrapper.vm.onConfirm).toBe(() => {})
expect(wrapper.vm.onConfirm).toBe(Function)
But both seems to be incorrect.