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