Skip to content

Instantly share code, notes, and snippets.

@vedovelli
Created May 11, 2021 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vedovelli/0775d834ef2c0687ea0516829944b1bf to your computer and use it in GitHub Desktop.
Save vedovelli/0775d834ef2c0687ea0516829944b1bf to your computer and use it in GitHub Desktop.
import {mount, createLocalVue} from '@vue/test-utils';
import Vuetify from 'vuetify';
export function factory (component, propsData) {
const vuetify = new Vuetify();
const localVue = createLocalVue();
return mount(component, {
propsData,
localVue,
vuetify,
})
}
// Uso
import {factory} from '@/tests/factory';
it('yadda yadda', () => {
const wrapper = factory(SeuComponent, {title: ''});
//... assertions
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment