-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
35 lines (33 loc) · 1009 Bytes
/
vitest.config.mjs
File metadata and controls
35 lines (33 loc) · 1009 Bytes
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 { defineConfig } from 'vitest/config';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [vue()],
test: {
environment: 'happy-dom', // Use happy-dom for faster DOM simulation
globals: true, // Makes test funcs available globally (describe, it, expect, etc.)
setupFiles: ['./tests/setup.js'],
include: ['tests/**/*.{test,spec}.{js,ts}', 'src/**/*.{test,spec}.{js,ts}'],
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'tests/',
'*.config.js',
'dist/',
'.github/',
'docs/',
],
},
},
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
alias: {
'@': path.resolve(__dirname, './src'), // same as the vite.config.ts
},
},
});