【发布时间】:2018-11-04 19:47:39
【问题描述】:
有一个带有 axios 设置的 Vue 应用程序,并在组件中将其用作 this.$http.get,并且工作正常。
在使用 Jest 运行规范时出现错误:Cannot read property 'get' of undefined
我知道我可以用 maxios 模拟 axios。如何让 Jest 识别 $http 使其不会引发错误?
【问题讨论】:
标签: vue.js axios jestjs vue-test-utils