-
Notifications
You must be signed in to change notification settings - Fork 1
/
vitest.config.mjs
39 lines (35 loc) · 1.41 KB
/
vitest.config.mjs
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
34
35
36
37
38
39
import { getViteConfig } from 'astro/config';
import path from 'node:path';
import packageJson from '../../package.json';
const GRID_PATH_PREFIX = '../../documentation/ag-grid-docs';
const CHARTS_PATH_PREFIX = '../../packages/ag-charts-website';
function resolvePath(srcPath) {
const pathPrefix = packageJson.name === 'ag-grid' ? GRID_PATH_PREFIX : CHARTS_PATH_PREFIX;
return path.resolve(__dirname, pathPrefix, srcPath);
}
export default getViteConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/test',
test: {
globals: true,
cacheDir: '../../node_modules/.vitest',
environment: 'node',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: { reportsDirectory: '../../coverage/ag-website-shared', provider: 'v8' },
},
resolve: {
alias: {
// Matches `tsconfig.json`
'@astro': resolvePath('src/astro'),
'@components': resolvePath('src/components'),
'@design-system': resolvePath('src/design-system'),
'@images': resolvePath('src/images'),
'@layouts': resolvePath('src/layouts'),
'@stores': resolvePath('src/stores'),
'@ag-grid-types': resolvePath('src/types/ag-grid.d.ts'),
'@utils': resolvePath('src/utils'),
'@constants': resolvePath('src/constants.ts'),
},
},
});