generated from innei-template/vite-react-tailwind-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvitest.config.ts
34 lines (28 loc) · 831 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
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import tsconfigPath from 'vite-tsconfig-paths'
import { defineProject } from 'vitest/config'
const pkg = JSON.parse(readFileSync('package.json', 'utf8'))
const __dirname = fileURLToPath(new URL('.', import.meta.url))
export default defineProject({
root: './',
test: {
globals: true,
setupFiles: [resolve(__dirname, './setup-file.ts')],
environment: 'happy-dom',
includeSource: [resolve(__dirname, '.')],
dom: true,
},
define: {
APP_VERSION: JSON.stringify(pkg.version),
APP_NAME: JSON.stringify(pkg.name),
APP_DEV_CWD: JSON.stringify(process.cwd()),
GIT_COMMIT_SHA: "'SHA'",
},
plugins: [
tsconfigPath({
projects: ['./tsconfig.json'],
}),
],
})