Files
BIPMaterialManager/vitest.config.ts
Misaka fe02e37848 test(P0): fix critical test infrastructure issues
- Add complete Electron mock with all required APIs (getVersion, getName, etc.) - fixes 20 failing suites
- Fix Winston format mock to support chainable calls - fixes logger test errors
- Add comprehensive TypeORM mock for repository tests - fixes 4 failing tests
- Fix bootstrap-runtime test path assertions
- Update Excel parser tests to skip file I/O (moved to integration)
- Add test review report and improvement plan documentation

## Test Results:
- Failed test suites: 20 → 6 (-70%)
- Failed tests: 48 → 16 (-67%)
- Pass rate: 67% → 94% (+27%)

## Remaining (P1/P2 - not blocking):
- logger.test.ts: 11 failures (config-manager circular dependency, needs refactoring)
- manual tests: 2 failures (should be moved to integration)
- Minor assertion fixes in update-service tests

Fixes: P0 test infrastructure issues
2026-04-04 18:36:38 +08:00

28 lines
695 B
TypeScript

import { defineConfig } from 'vitest/config'
import path from 'path'
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['tests/**/*.{test,spec}.{ts,tsx}'],
exclude: ['node_modules', 'dist', 'out', 'tests/e2e'],
setupFiles: ['tests/setup.ts'],
env: {
NODE_ENV: 'test'
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html']
}
},
resolve: {
alias: {
'@main': path.resolve(__dirname, './src/main'),
'@services': path.resolve(__dirname, './src/main/services'),
'@types': path.resolve(__dirname, './src/main/types'),
'@': path.resolve(__dirname, './src')
}
}
})