Unit testing 带引导vue的单元/Jest测试失败
我在尝试对引导vue组件运行测试时遇到此错误:Unit testing 带引导vue的单元/Jest测试失败,unit-testing,testing,jestjs,vuex,bootstrap-vue,Unit Testing,Testing,Jestjs,Vuex,Bootstrap Vue,我在尝试对引导vue组件运行测试时遇到此错误: “引用错误:未定义BootstrapVue” 在.spec.js文件中,我添加了以下内容: import TableSummary from "@/components/TableSummary"; import { createLocalVue, mount } from "@vue/test-utils"; const localVue = createLocalVue(); lo
“引用错误:未定义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级,所以我不得不提出一个新问题