Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 583 Bytes

exists.md

File metadata and controls

20 lines (14 loc) · 583 Bytes

exists()

Проверка, что Wrapper или WrapperArray существует.

Возвращает false, если вызывается на пустом Wrapper или WrapperArray.

  • Возвращает: {boolean}

  • Пример:

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

const wrapper = mount(Foo)
expect(wrapper.exists()).toBe(true)
expect(wrapper.find('does-not-exist').exists()).toBe(false)
expect(wrapper.findAll('div').exists()).toBe(true)
expect(wrapper.findAll('does-not-exist').exists()).toBe(false)