Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 660 Bytes

filter.md

File metadata and controls

22 lines (14 loc) · 660 Bytes

filter(predicate)

Filter WrapperArray with a predicate function on Wrapper objects.

Behavior of this method is similar to Array.prototype.filter.

  • Arguments:

    • {function} predicate
  • Returns: {WrapperArray}

A new WrapperArray instance containing Wrapper instances that returns true for the predicate function.

  • Example:
import { shallowMount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = shallowMount(Foo)
const filteredDivArray = wrapper.findAll('div').filter(w => !w.hasClass('filtered'))