test: add Vitest configuration and setup
- 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>
This commit is contained in:
36
desktop/vitest.config.ts
Normal file
36
desktop/vitest.config.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
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'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user