-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
35 lines (34 loc) · 955 Bytes
/
vitest.config.ts
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
import { fileURLToPath } from 'node:url';
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config';
import viteConfig from './vite.config';
import { loadEnv } from 'vite';
export default mergeConfig(
viteConfig,
defineConfig({
test: {
globals: true,
env: loadEnv('', process.cwd(), ''),
environment: 'jsdom',
workspace: [{
extends: true,
test: {
name: 'app',
environment: 'jsdom',
globals: true,
include: ['src/**/*.test.ts'],
exclude: [...configDefaults.exclude],
root: fileURLToPath(new URL('./', import.meta.url)),
}
}, {
test: {
name: 'vercel-api',
environment: 'node',
globals: true,
include: ['api/**/*.test.ts'],
exclude: [...configDefaults.exclude],
root: fileURLToPath(new URL('./', import.meta.url)),
}
}],
},
}),
);