Created
May 11, 2021 12:32
-
-
Save vedovelli/0775d834ef2c0687ea0516829944b1bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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