Permalink
Switch branches/tags
v2.9.1 v2.9.0 v2.8.2 v2.8.1 v2.8.0 v2.7.1 v2.7.0 v2.6.0 v2.5.2 v2.5.1 v2.5.0 v2.4.2 v2.4.1 v2.4.0 v2.3.0 v2.2.0 v2.1.0 v2.0.0 v1.6.0 v1.5.0 v1.4.1 v1.4.0 v1.3.1 v1.3.0 v1.2.0 v1.1.0 v1.0.0 reagent-v1.0.1 reagent-v1.0.0 enzyme@3.7.0 enzyme@3.6.0 enzyme@3.5.1 enzyme@3.5.0 enzyme@3.4.4 enzyme@3.4.3 enzyme@3.4.2 enzyme@3.4.1 enzyme@3.4.0 enzyme@3.3.0 enzyme@3.2.0 enzyme@3.1.1 enzyme@3.1.0 enzyme@3.0.0 enzyme@3.0.0-beta.7 enzyme@3.0.0-beta.6 enzyme@3.0.0-beta.5 enzyme@3.0.0-beta.4 enzyme@3.0.0-beta.3 enzyme@3.0.0-beta.2 enzyme@3.0.0-beta.1 enzyme-test-suite@1.0.0 enzyme-test-suite@1.0.0-beta.7 enzyme-test-suite@1.0.0-beta.6 enzyme-test-suite@1.0.0-beta.5 enzyme-test-suite@1.0.0-beta.4 enzyme-test-suite@1.0.0-beta.3 enzyme-test-suite@1.0.0-beta.2 enzyme-test-suite@1.0.0-beta.1 enzyme-example-mocha@0.1.0 enzyme-adapter-utils@1.9.0 enzyme-adapter-utils@1.8.1 enzyme-adapter-utils@1.8.0 enzyme-adapter-utils@1.7.0 enzyme-adapter-utils@1.6.1 enzyme-adapter-utils@1.6.0 enzyme-adapter-utils@1.5.0 enzyme-adapter-utils@1.4.0 enzyme-adapter-utils@1.3.0 enzyme-adapter-utils@1.2.0 enzyme-adapter-utils@1.1.1 enzyme-adapter-utils@1.1.0 enzyme-adapter-utils@1.0.1 enzyme-adapter-utils@1.0.0 enzyme-adapter-utils@1.0.0-beta.7 enzyme-adapter-utils@1.0.0-beta.6 enzyme-adapter-utils@1.0.0-beta.5 enzyme-adapter-utils@1.0.0-beta.4 enzyme-adapter-utils@1.0.0-beta.3 enzyme-adapter-utils@1.0.0-beta.2 enzyme-adapter-utils@1.0.0-beta.1 enzyme-adapter-react-helper@1.3.1 enzyme-adapter-react-helper@1.3.0 enzyme-adapter-react-helper@1.2.3 enzyme-adapter-react-helper@1.2.2 enzyme-adapter-react-helper@1.2.1 enzyme-adapter-react-helper@1.2.0 enzyme-adapter-react-helper@1.1.0 enzyme-adapter-react-helper@1.0.3 enzyme-adapter-react-helper@1.0.2 enzyme-adapter-react-helper@1.0.1 enzyme-adapter-react-helper@1.0.0 enzyme-adapter-react-16.3@1.4.0 enzyme-adapter-react-16.3@1.3.0 enzyme-adapter-react-16.3@1.2.0 enzyme-adapter-react-16.3@1.1.1 enzyme-adapter-react-16.3@1.1.0 enzyme-adapter-react-16.3@1.0.0 enzyme-adapter-react-16.2@1.3.0 enzyme-adapter-react-16.2@1.2.1 enzyme-adapter-react-16.2@1.2.0
Nothing to show
Find file Copy path
a295181 Feb 1, 2016
2 contributors

Users who have contributed to this file

@lelandrichardson @blainekasten
29 lines (16 sloc) 579 Bytes

.state([key]) => Any

Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value.

Arguments

  1. key (String [optional]): If provided, the return value will be the this.state[key] of the root component instance.

Example

const wrapper = mount(<MyComponent />);
expect(wrapper.state().foo).to.equal(10);
expect(wrapper.state('foo')).to.equal(10);

Related Methods