Bootstrap Vue失败的单元/ Jest测试

问题描述

当我尝试对Bootstrap Vue组件运行测试时出现此错误:
“ ReferenceError:未定义BootstrapVue” 在.spec.js文件中,我添加了以下内容:

  import TableSummary from "@/components/TableSummary";
  import { createLocalVue,mount } from "@vue/test-utils";

   const localVue = createLocalVue();

   localVue.use(BootstrapVue);

   describe('TableSummary',()=> {
     test('if the user is typing,the button becomes enabled',async ()=> {
       const wrapper = mount(TableSummary,{ localVue });
       wrapper.setData({isDisabled: true});
       await wrapper.vm.$nextTick;
       expect(wrapper.find('input').state.isDisabled).toBe(false);
     });
   });

在堆栈溢出时,我在此处运行了与正确答案相同的指令,但仍然对我不起作用...我无法评论答案,因为我不是50级,所以我不得不打开一个新问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)