34 lines
744 B
JavaScript
34 lines
744 B
JavaScript
import { mount, flushPromises } from '@vue/test-utils';
|
|
import { installQuasarPlugin } from '@quasar/quasar-app-extension-testing-unit-jest';
|
|
import { i18n } from 'src/boot/i18n';
|
|
import { Notify } from 'quasar';
|
|
import axios from 'axios';
|
|
|
|
// Specify here Quasar config you'll need to test your component
|
|
installQuasarPlugin({
|
|
plugins: {
|
|
Notify
|
|
}
|
|
});
|
|
|
|
export function createWrapper(component, options) {
|
|
const mountOptions = {
|
|
global: {
|
|
plugins: [i18n]
|
|
}
|
|
};
|
|
|
|
if (options instanceof Object)
|
|
Object.assign(mountOptions, options)
|
|
|
|
const wrapper = mount(component, mountOptions);
|
|
const vm = wrapper.vm;
|
|
|
|
return { vm, wrapper };
|
|
}
|
|
|
|
export {
|
|
axios,
|
|
flushPromises
|
|
}
|