- Add vitest.config.ts with jsdom environment and path aliases - Add tests/setup.ts with mocks for Tauri API, crypto, and localStorage - Add test:coverage script to package.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
833 B
TypeScript
37 lines
833 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: [path.resolve(__dirname, './tests/setup.ts')],
|
|
include: ['tests/**/*.test.ts', 'tests/**/*.test.tsx'],
|
|
exclude: ['tests/e2e/**', 'node_modules/**'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
exclude: [
|
|
'node_modules/**',
|
|
'tests/**',
|
|
'**/*.d.ts',
|
|
'**/*.config.*',
|
|
'src/main.tsx',
|
|
],
|
|
thresholds: {
|
|
lines: 60,
|
|
functions: 60,
|
|
branches: 60,
|
|
statements: 60,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
});
|