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 html

Returns HTML of Wrapper DOM node as a string. Retorna o HTML do nó do DOM do Wrapper como uma sequência de caracteres (string).

  • Retorna: {string}

  • Exemplo:

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

const wrapper = mount(Foo)
expect(wrapper.html()).toBe('<div><p>Foo</p></div>')