Hello everyone,
What diference between Shallow and Mount render when I test a React component?
Hello everyone,
What diference between Shallow and Mount render when I test a React component?
For further actions, you may consider blocking this person and/or reporting abuse
gleamso -
Bregwin Jogi -
Muhammad Bilal -
ramadhan.dev -
Top comments (2)
Shallow only mounts the component and "mocks" the rendered output of it's children. Mount renders the entire component tree. You can print
wrapper.debug()
to see the difference clearly.Using shallow your tests run much faster, and are less prone to side effects, so the general rule of thumb is that you should always use Shallow, unless you need Mount.
Thks Dor :D