使用vue test utils作單元測試

mount和shallowMount的區別 mount是完整的渲染(推薦使用) shallowMount渲染的子組件是假的,也就是隻mount了這一層html 測試props的時候只能經過html來測試 不能直接經過wrapper.props().屬性,來測試,要經過html上的原生屬性來測試 好比測試input接受valueapp //正確的測試 it('接受value', () => {
相關文章
相關標籤/搜索