-
Notifications
You must be signed in to change notification settings - Fork 181
/
vitest.config.ts
40 lines (36 loc) · 952 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
36
37
38
39
40
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vitest/config'
import { compilerOptions } from './tsconfig.json'
const resolvePaths = () => {
return Object.fromEntries(
Object.entries(compilerOptions.paths || {}).map(([key, value]) => [
key.replace('/*', ''),
resolve(__dirname, value[0].replace('/*', '/')),
])
)
}
export default defineConfig({
plugins: [vue()],
test: {
setupFiles: './vitest.setup.ts',
environment: 'jsdom',
globals: true,
reporters: ['basic'],
include: ['**/*.spec.{ts,tsx,js,jsx}'],
outputFile: {
junit: './junit-report.xml',
},
coverage: {
provider: 'v8',
reportsDirectory: 'coverage',
reporter: ['text', 'text-summary'],
include: ['src/**/*.ts'],
exclude: ['*.spec.ts']
},
alias: resolvePaths(),
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
})