使用vue test utils作单元测试

mount和shallowMount的区别 mount是完整的渲染(推荐使用) shallowMount渲染的子组件是假的,也就是只mount了这一层html 测试props的时候只能经过html来测试 不能直接经过wrapper.props().属性,来测试,要经过html上的原生属性来测试 好比测试input接受valueapp //正确的测试 it('接受value', () => {
相关文章
相关标签/搜索