Sometimes you have to mount a component for it too fully render e.g. in the case of functional components. However when snapshotting the rendered enzyme wrapper, you do not need the entire tree.
Currently there are two options deep and shallow. Deep does the entire tree which most times is not what you want to snapshot. Shallow only serializes the initial component instance.
Adding the ability to specify depth would be great for cases where you need to only snapshot to a certain level of granularity.
Description
Sometimes you have to mount a component for it too fully render e.g. in the case of functional components. However when snapshotting the rendered enzyme wrapper, you do not need the entire tree.
Currently there are two options
deep
andshallow
. Deep does the entire tree which most times is not what you want to snapshot. Shallow only serializes the initial component instance.Adding the ability to specify depth would be great for cases where you need to only snapshot to a certain level of granularity.
0
mode: shallow
1
..
Infinity
mode: deep
Note
Workarounds do exist e.g.