You’re browsing the documentation for Vue Test Utils for Vue v2.x and earlier.
To read docs for Vue Test Utils for Vue 3, click here.
O método createWrapper(node [, options])
Argumentos:
{vm|HTMLElement} node
{Object} options
{Boolean} attachedToDocument
Retorna:
{Wrapper}
Uso:
O createWrapper
cria um Wrapper
para uma instância do Vue montada, ou um elemento HTML.
import { createWrapper } from '@vue/test-utils'
import Foo from './Foo.vue'
const Constructor = Vue.extend(Foo)
const vm = new Constructor().$mount()
const wrapper = createWrapper(vm)
expect(wrapper.vm.foo).toBe(true)