2017-04-07 7 views
0

エンハンサー浅いレンダラーに問題があります。私のwrapper.root.nodeは単純なdiv要素でもnullを返す。エンハンサー浅いレンダラーがnullノードエレメントを返します

 const wrapper = shallow(
      <div>asd</div> 
     ); 

ここにShallowWrapperオブジェクトがあります。ノード要素はnullですが、未レンダリングプロパティには通常のレンダリングオブジェクトが含まれます。何故ですか ?

ShallowWrapper { 
    "complexSelector": ComplexSelector { 
    "buildPredicate": [Function], 
    "childrenOfNode": [Function], 
    "findWhereUnwrapped": [Function], 
    }, 
    "length": 1, 
    "node": null, 
    "nodes": Array [ 
    null, 
    ], 
    "options": Object {}, 
    "renderer": ReactShallowRenderer { 
    "_instance": null, 
    "getRenderOutput": [Function], 
    "render": [Function], 
    }, 
    "root": [Circular], 
    "unrendered": <div> 
    asd 
</div>, 
} 

答えて

0

[OK]を、冗談に起因する問題は '反応-DOM' モック:他のファイルにユニットテストを移動させることによって解決

jest.mock('react-dom') 

通報。

関連する問題