-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
33 lines (31 loc) · 920 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 viteConfig from './vite.config'
import { mergeConfig } from 'vite'
import { version as pkgVersion } from './package.json'
import { defineConfig } from 'vitest/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: 'jsdom',
include: ['tests/unit/**/*.test.ts', 'src/**/*.spec.ts'],
root: fileURLToPath(new URL('./', import.meta.url)),
setupFiles: ['./tests/setup/testglobals.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'json-summary'],
thresholds: {
lines: 10,
functions: 0,
branches: 10,
statements: 10,
},
},
},
})
)