Finds every node in the render tree that returns true for the provided predicate function.
predicate
(ShallowWrapper => Boolean
): A predicate function called with the passed in wrapped nodes.ShallowWrapper
: A new wrapper that wraps the found nodes.
const wrapper = shallow(<MyComponent />); const complexComponents = wrapper.findWhere(n => n.type() !== 'string'); expect(complexComponents).to.have.lengthOf(8);
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://airbnb.io/enzyme/docs/api/ShallowWrapper/findWhere.html