-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
33 lines (31 loc) · 1.05 KB
/
Copy pathvitest.config.mjs
File metadata and controls
33 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react-swc'
import svgr from 'vite-plugin-svgr'
import path from 'path'
const drcDist = path.resolve(__dirname, './node_modules/iguazio.dashboard-react-controls/dist')
export default defineConfig({
plugins: [react(), svgr()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.js',
include: ['src/**/*.{test,spec}.{js,jsx}'],
exclude: ['node_modules', 'build', 'dist'],
server: {
deps: {
inline: ['iguazio.dashboard-react-controls'],
moduleDirectories: ['node_modules']
},
},
alias: [
{ find: /^igz-controls\/images\/(.+)\.svg\?react$/, replacement: path.join(__dirname, 'src/__mocks__/svgMock.jsx') }
],
},
resolve: {
alias: [
{ find: 'igz-controls/nextGenComponents', replacement: path.join(drcDist, 'nextGenComponents/index.mjs') },
{ find: 'igz-controls', replacement: drcDist },
{ find: '@', replacement: path.resolve(__dirname, './src/nextGenComponents') }
]
}
})