Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 365 Bytes

setData.md

File metadata and controls

22 lines (14 loc) · 365 Bytes

setData

Sets Wrapper vm data.

setData works by recursively calling Vue.set.

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')