vue单元测试---组件挂载mount和shallowMount区别mount会渲染整个组件树而shallowMount在挂载组件之前对所有子组件进行存根。shallowMount可以确保你对一个组件进行独立测试,有助于避免测试中因子组件的渲染输出而混乱结果。使用建议mount适合小组件测试shallowMount适合多场景测试(能用shallowMount就不用mount)版权声明:本文为lixiaolong240035原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/lixiaolong240035/article/details/117339289