Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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])
Source by vue-test-utils.vuejs.org #
 
PREVIOUS NEXT
Tagged: #vue #test #utils #emitted
ADD COMMENT
Topic
Name
8+4 =