【发布时间】:2022-01-18 03:17:57
【问题描述】:
我收到此错误:
[Vue warn]: Unknown custom element: <b-taginput> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
关于这个测试:
import MultipleChoice from '@/components/MultipleChoice';
import Buefy from 'buefy';
const localVue = createLocalVue();
localVue.use(Buefy);
describe('MultipleChoice.vue', () => {
let wrapper;
beforeEach(() => {
wrapper = shallowMount(MultipleChoice, {
propsData: {
choices: ['en', 'de', 'it'],
}
});
});
test('renders correctly', () => {
expect(wrapper).toMatchSnapshot();
});
});
测试本身通过,但此警告不断出现。
这是我的组件:
<b-taginput
v-model="value"
:data="filteredData"
expanded
autocomplete
open-on-focus
clear-on-select
field="display_name"
icon="label"
@input="update()" />
有人知道怎么回事吗?
【问题讨论】:
标签: vue.js unit-testing jestjs buefy