-
Notifications
You must be signed in to change notification settings - Fork 272
Closed
Description
I am having trouble getting the tests to work with Vite, specifically due to the import
object that is provided. One example is loading in global components using Vue Test Utils config:
hitting an issue with globEager
when trying to provide plugins to config
Here my plugin:
export default {
install: (app, _options) => {
const components = import.meta.globEager('../components/base_components/*.vue');
Object.entries(components).forEach(([path, definition]) => {
const componentName = path.split('/').pop().replace(/\.\w+$/, '');
app.component(componentName, definition.default);
});
},
};
I am trying to pass this plugin in my setup script for Jest using Vue Test Utils:
import { config } from '@vue/test-utils';
import globalComponents from '@/plugins/globalComponents';
config.global.plugins = [globalComponents];
But I get an error process.globEager is not a function
Metadata
Metadata
Assignees
Labels
No labels