在使用babel-plugin-component的时候,vue jest单元测试失败
yujie0707 opened this issue · comments
`import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import { Button } from 'element-ui';
import Country from '@/components/a.vue';
const localVue = createLocalVue();
localVue.use(Button);
Vue.prototype.$ELEMENT = { size: 'small' };
const wrapper = shallowMount(Country, {
localVue,
propsData: {
visible: true,
},
});
describe('选人组件', () => {
const { vm } = wrapper;
it('currentLeaf', () => {
expect(vm.currentLeaf).toBe(undefined);
});
});`