mocheng / react-and-redux

《深入浅出React和Redux》代码

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The test code in Ch.6/hoc could not run within react v16 environment

baxtergu opened this issue · comments

might caused by:

react-addons-test-utils is deprecated as of version 15.5.0:

  • TestUtils have been moved to react-dom/test-utils
  • Shallow renderer has been moved to react-test-renderer/shallow

enzyme now has an "Adapter" system. Link

The way to write test case might slightly different from before. I am not familiar with the test in react so I could not solve this issue by myself. Is there anyone else could solve this?

这本书写完的时候v16还没有发布,所有的代码都是基于React v15,v16是一个major version change,肯定会有breaking change。