0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/packages/ui-components/vitest.config.mjs

40 lines
1.1 KiB
JavaScript
Raw Normal View History

import react from '@vitejs/plugin-react';
import path from 'node:path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./vitest/setup.ts', './vitest/setup-env.ts'],
exclude: ['node_modules', './build/'],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
snapshotSerializers: ['./vitest/vitestSerializer.ts'],
alias: {
// https://github.com/vitest-dev/vitest/issues/5664#issuecomment-2093986338
'@emotion/react': path.resolve('node_modules/@emotion/react/dist/emotion-react.cjs.mjs'),
'\\.(s?css)$': './vitest/identity.js',
'\\.(png)$': './vitest/identity.js',
'\\.(svg)$': './vitest/unit/empty.ts',
'\\.(jpg)$': './vitest/unit/empty.ts',
'\\.(md)$': './vitest/unit/empty-string.ts',
},
},
plugins: [
react({
babel: {
plugins: ['@emotion'],
},
}),
],
resolve: {
alias: {
'verdaccio-ui/components': path.resolve(__dirname, './src/components'),
'verdaccio-ui/utils': path.resolve(__dirname, './src/utils'),
},
},
});