Vue Test Utils wrapper.vm method code example
Example 1: vue test utils emitted
// assert event has been emitted
expect(wrapper.emitted('foo')).toBeTruthy()
// assert event count
expect(wrapper.emitted('foo').length).toBe(2)
// assert event payload
expect(wrapper.emitted('foo')[1]).toEqual([123])
Example 2: expect vue test utils compare objects
expect(data).toEqual({uno: 1, dos: 2});