Skip to content

Commit

Permalink
install react-test-render for removing enzyme warning
Browse files Browse the repository at this point in the history
Enzyme recently made a fix for console warning if we use React v15.5+ , See issue here: enzymejs/enzyme#876

To fix that, we have to install react-test-render instead of react-addons-test-utils

Warning:
``` 
 console.error node_modules/fbjs/lib/warning.js:36
    Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning.

  console.error node_modules/fbjs/lib/warning.js:36
    Warning: Shallow renderer has been moved to react-test-renderer/shallow. Update references to remove this warning.
```
  • Loading branch information
davidctj committed Apr 19, 2017
1 parent 0650967 commit e0669dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/TutorialReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The code for this example is available at

If you'd like to assert, and manipulate your rendered components you can use [Enzyme](http://airbnb.io/enzyme/) or React's [TestUtils](http://facebook.github.io/react/docs/test-utils.html). We use Enzyme for this example.

You have to run `npm install --save-dev enzyme react-addons-test-utils` to use Enzyme (`react-addons-test-utils` is a peer dependency).
You have to run `npm install --save-dev enzyme react-addons-test-utils` to use Enzyme (`react-addons-test-utils` is a peer dependency). If your react version is above 15.5+, run `npm install --save-dev enzyme react-test-render` to use Enzyme instead.

Let's implement a simple checkbox which swaps between two labels:

Expand Down

2 comments on commit e0669dd

@VishalGulati
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I fix this for React v 15.1.0?

@davidctj
Copy link
Owner Author

@davidctj davidctj commented on e0669dd Feb 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VishalGulati , it should not have any problem below v15.5 , you could use react-addons-test-utils

Please sign in to comment.