I had a similar problem when the user interface components were not recognized.
I had to import createLocalVue and ElementUI into a test file
import { shallow, mount, createLocalVue } from '@vue/test-utils' import Vue from 'vue'; import ElementUI from 'element-ui'; import Editor from '../src/components/layout/Editor'
and then
const localVue = createLocalVue(); localVue.use(ElementUI);
and then
describe('Editor', () => { let wrapper beforeEach(() => { wrapper = shallow(Editor, {localVue}, { data : { x: '0', y: '0', } }) }) it('renders a vue instance', () => { expect(wrapper.isVueInstance()).toBe(true); })
source share