Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 673 Bytes

emittedByOrder.md

File metadata and controls

33 lines (23 loc) · 673 Bytes

emittedByOrder

::: warning Deprecation warning emittedByOrder is deprecated and will be removed in future releases.

Use wrapper.emitted instead. :::

Return an Array containing custom events emitted by the Wrapper vm.

  • Returns: Array<{ name: string, args: Array<any> }>

  • Example:

import { mount } from '@vue/test-utils'

const wrapper = mount(Component)

wrapper.vm.$emit('foo')
wrapper.vm.$emit('bar', 123)

/*
wrapper.emittedByOrder() returns the following Array:
[
  { name: 'foo', args: [] },
  { name: 'bar', args: [123] }
]
*/

// assert event emit order
expect(wrapper.emittedByOrder().map(e => e.name)).toEqual(['foo', 'bar'])