Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 411 Bytes

setData.md

File metadata and controls

21 lines (14 loc) · 411 Bytes

setData(data)

Sets Wrapper vm data.

setData works by merging existing properties, except for arrays which are overwritten.

Note the Wrapper must contain a Vue instance.

  • Arguments:

    • {Object} data
  • Example:

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

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')