Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 506 Bytes

exists.md

File metadata and controls

20 lines (14 loc) · 506 Bytes

exists()

断言 WrapperWrapperArray 是否存在。

如果被一个空 WrapperWrapperArray 调用则返回 false

  • 返回值:{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)