Jest: TypeError: wrapper.xxx is not a function

wrapper声明

let wrapper = null
const makeWrapper = ()=>{
  wrapper = shallowMount( unittest, {localVue}, {})
}
错误
wrapper.getNumber
正确
wrapper.vm.getNumber

你可能感兴趣的:(Jest: TypeError: wrapper.xxx is not a function)