Enzyme: when to use small ones, rendering or mounting?

From Enzyme docs shallow , render and mount are described, but when to use which method?

+6
source share
1 answer

not deep

  • Submitting child items
  • Isolated, you definitely know the error here.

Render

  • No life cycles
  • Children rendering
  • Less API ( setState, debug...)

mount

Requires jsdom or the like.

  • Life cycle methods, for example componentDidMount
  • Children rendering

, , , mount, <Provider> , , shallow .

post .

+14

Source: https://habr.com/ru/post/1017406/


All Articles