- Add vitest, @testing-library/react, @vitest/ui, jsdom dependencies - Create vitest.config.ts with jsdom environment and coverage settings - Add tests/setup.ts with localStorage mock and crypto mock - Add tests/gateway/ws-client.test.ts for GatewayClient unit tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
866 B
TypeScript
34 lines
866 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: ['./tests/setup.ts'],
|
|
include: ['tests/**/*.test.ts', 'tests/**/*.test.tsx'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
reportsDirectory: './coverage',
|
|
include: ['src/**/*.ts', 'desktop/src/**/*.ts', 'desktop/src/**/*.tsx'],
|
|
exclude: [
|
|
'src/**/*.d.ts',
|
|
'desktop/src/**/*.d.ts',
|
|
'tests/**',
|
|
'**/*.test.ts',
|
|
'**/*.test.tsx',
|
|
'**/node_modules/**',
|
|
],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './desktop/src'),
|
|
'@lib': path.resolve(__dirname, './desktop/src/lib'),
|
|
},
|
|
},
|
|
});
|