We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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); }); });
// babel.config.js // 当注释掉plugins配置,上述内容才不报错 module.exports = { presets: [ '@vue/app', ], // plugins: [ // [ // 'component', // { // libraryName: 'element-ui', // styleLibraryName: 'theme-chalk', // }, // ], // ], };
The text was updated successfully, but these errors were encountered:
大佬,问题解决没?
Sorry, something went wrong.
Try mock .css file by jest-transform-stub:
jest-transform-stub
module.exports = { ... moduleNameMapper: { '^.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', ... } }
No branches or pull requests
报错内容如下
The text was updated successfully, but these errors were encountered: