A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/forEach.html below:

forEach(fn) ยท Enzyme

.forEach(fn) => Self

Iterates through each node of the current wrapper and executes the provided function with a wrapper around the corresponding node passed in as the first argument.

Arguments
  1. fn (Function ( ShallowWrapper node, Number index )): A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first argument, and will be run with a context of the original instance.
Returns

ShallowWrapper: Returns itself.

Example
const wrapper = shallow((
  <div>
    <div className="foo bax" />
    <div className="foo bar" />
    <div className="foo baz" />
  </div>
));

wrapper.find('.foo').forEach((node) => {
  expect(node.hasClass('foo')).to.equal(true);
});

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4