nextcloud-vue/vitest.config.ts

18 строки
535 B
TypeScript

import type { UserConfig } from 'vite'
import { resolve } from 'node:path'
import viteConfig from './vite.config'
export default async (env) => {
const config = typeof viteConfig === 'function' ? await viteConfig(env) : viteConfig
// node-externals conflicts with vitest
config.plugins = config.plugins!.filter((plugin) => plugin && (!('name' in plugin) || plugin?.name !== 'node-externals'))
return {
...config,
test: {
environment: 'jsdom',
setupFiles: resolve(__dirname, './tests/setup.js'),
},
} as UserConfig
}