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.

isEmpty

Deprecation warning

isEmpty is deprecated and will be removed in future releases.

Consider a custom matcher such as those provided in jest-dom.

When using with findComponent, access the DOM element with findComponent(Comp).element

Assert Wrapper does not contain child node.

  • Returns: {boolean}

  • Example:

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

const wrapper = mount(Foo)
expect(wrapper.isEmpty()).toBe(true)