Repository navigation
Expand file tree
/
Copy pathvitest.config.js
More file actions
38 lines (36 loc) · 1.49 KB
/
Copy pathvitest.config.js
File metadata and controls
38 lines (36 loc) · 1.49 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
34
35
36
37
38
import path from 'path';
import { configDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
// Match Next.js's automatic JSX runtime so .jsx files don't need an
// `import React from 'react'` line just for the JSX transform. This is
// a no-op for files that don't use JSX (most of our pure-helper tests).
esbuild: {
jsx: 'automatic',
},
test: {
environment: 'happy-dom',
exclude: [...configDefaults.exclude, 'tests/critical-flows/**', '**/.claude/**'],
globals: true,
setupFiles: ['./vitest.setup.js'],
},
resolve: {
// Mirrors jsconfig.json `baseUrl: src` — every top-level src/* directory is
// importable as a bare specifier (e.g. `import foo from 'components/...'`).
// Adding a new src/* subdir? Add it here too.
alias: {
'@': path.resolve(__dirname, './src'),
app: path.resolve(__dirname, './src/app'),
components: path.resolve(__dirname, './src/components'),
config: path.resolve(__dirname, './src/config'),
constants: path.resolve(__dirname, './src/constants'),
contexts: path.resolve(__dirname, './src/contexts'),
data: path.resolve(__dirname, './src/data'),
hooks: path.resolve(__dirname, './src/hooks'),
icons: path.resolve(__dirname, './src/icons'),
images: path.resolve(__dirname, './src/images'),
lib: path.resolve(__dirname, './src/lib'),
styles: path.resolve(__dirname, './src/styles'),
utils: path.resolve(__dirname, './src/utils'),
},
},
});