0👍
You could mock $emit
on the mounted component with the mocks
mounting option:
const $emit = jest.fn()
shallowMount(MyComponent, {
mocks: {
$emit
}
})
expect($emit).toHaveBeenCalledWith('some-emit', { foo: 1 })
Source:stackexchange.com