Skip to content

Commit

Permalink
Clarify in the docs that shallow does call lifecycle methods in v3.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfranklin authored and ljharb committed Dec 18, 2017
1 parent 0a513b7 commit d259849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions docs/api/mount.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Full Rendering API (`mount(...)`)

Full DOM rendering is ideal for use cases where you have components that may interact with DOM APIs,
or may require the full lifecycle in order to fully test the component (i.e., `componentDidMount`
etc.)
Full DOM rendering is ideal for use cases where you have components that may interact with DOM APIs or need to test components that are wrapped in higher order components.

Full DOM rendering requires that a full DOM API be available at the global scope. This means that
it must be run in an environment that at least “looks like” a browser environment. If you do not
Expand Down
2 changes: 2 additions & 0 deletions docs/api/shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure
that your tests aren't indirectly asserting on behavior of child components.

As of Enzyme v3, the `shallow` API does call React lifecycle methods such as `componentDidMount` and `componentDidUpdate`.

```jsx
import { shallow } from 'enzyme';
import sinon from 'sinon';
Expand Down

0 comments on commit d259849

Please sign in to comment.