我正在测试一些反应组件,一个基本的测试套件,只是为了知道组件是否正在渲染以及他们的孩子。
1) Test suite Stepper Stepper:
**TypeError: Cannot read property 'length' of undefined**
at Stepper.render (D:/SAPADS/build/operation/common/stepper/Stepper.jsx:7:18)
at D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:796:21
at measureLifeCyclePerf (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:75:12)
at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:795:25)
at ReactCompositeComponentWrapper._renderValidatedComponent (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:822:32)
at ReactCompositeComponentWrapper.performInitialMount (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:362:30)
at ReactCompositeComponentWrapper.mountComponent (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:258:21)
at Object.mountComponent (D:\SAPADS\build\node_modules\react-dom\lib\ReactReconciler.js:46:35)
at ReactCompositeComponentWrapper.performInitialMount (D:\SAPADS\build\node_modules\react-dom\lib\ReactCompositeComponent.js:371:34)
使用Enzyme + Mocha.Pls运行测试用例时出错会帮助我解决这个问题。