当我为表单提交编写测试用例时,遇到了1个wrapper.vm.$refs.editForm.validate is not a function的问题。 我不能弄清楚这个问题。请帮帮我。@vue/cli-plugin-eslint": "^3.11.0", "@vue/cli-plugin-pwa": "^3.11.0", "@vue/cli-plugin-unit-jest": "^1.0.0-
我正在为我的vue组件使用一个名为headroom的节点模块。我试图模拟这个库并编写测试,但是我得到了一个this.$refs.headroom._setHeightOffset is not a function,它似乎没有定义$ref中的函数。shallowMount,并像下面这样模拟导入的库,但是它仍然没有在我的测试中获得这个函数。jest.mock('vue-headroom', () => ({ headr
假设您有一个vue组件,其方法如下: methods:{ //maybe do something with that Parameter$store.commit("storeSomethingElse",someParameter2);} 我必须做些什么,才能让这种测试在Jest中工作?that the commit was correctly called",()=>{
wrapper.vm.do