Files
dashy/vitest.config.mjs
2026-03-09 13:01:03 +00:00

36 lines
1009 B
JavaScript

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
},
},
});