-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
33 lines (31 loc) · 962 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
import { fileURLToPath, URL } from 'node:url'
import { mergeConfig } from 'vite'
import { defineConfig } from 'vitest/config'
import { version as pkgVersion } from './package.json'
import viteConfig from './vite.config'
process.env.VITE_APP_VERSION = pkgVersion
if (process.env.NODE_ENV === 'production') {
process.env.VITE_APP_BUILD_EPOCH = new Date().getTime().toString()
}
export default mergeConfig(
viteConfig,
defineConfig({
test: {
globals: true,
environment: 'happy-dom',
include: ['tests/unit/**/*.test.ts', 'tests/unit/**/*.spec.ts', 'src/**/*.spec.ts'],
root: fileURLToPath(new URL('./', import.meta.url)),
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'json-summary'],
include: ['!src/dev.ts', 'src/**/*.ts', 'src/**/*.vue'],
thresholds: {
lines: 10,
functions: 0,
branches: 0,
statements: 0,
},
},
},
})
)