test: configure Vitest testing framework
- 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>
This commit is contained in:
33
vitest.config.ts
Normal file
33
vitest.config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user