Files
adnify/vitest.config.ts
T
adnaan 8388e9dcce test: reorganize test structure and add comprehensive test coverage
- Reorganize test files into logical directory structure (unit/, agent/, services/, integration/)
- Move context-related tests to agent/context/ subdirectory
- Move tool tests to agent/tools/ subdirectory
- Move utility tests to unit/utils/ subdirectory
- Move shared module tests to unit/shared/ subdirectory
- Add new test files for agent core functionality (loop, stream, tools)
- Add new test files for LLM components (ContextBuilder, MessageBuilder)
- Add new test files for agent services (gitService, sessionService)
- Add new test files for store management (AgentStore)
- Add new test files for renderer services (WorkspaceManager, mcpService)
- Add integration test for agent workflow
- Add global test setup file (setup.ts) for shared configuration and mocks
- Add comprehensive README.md documenting test structure and conventions
- Update vitest.config.ts to support new directory structure
- Remove obsolete test files (GhostTextWidget.property.test.ts, pathUtils.test.ts, replace_file_content.test.ts, errors.test.ts, ToolCallCard.memo.test.ts)
- Update import paths to use path aliases (@renderer, @main, etc.)
- Improves test maintainability and follows modular organization pattern
2026-01-15 15:21:21 +08:00

36 lines
1.2 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import path from 'path'
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./tests/setup.ts'],
include: [
'src/**/*.{test,spec,property}.{ts,tsx}',
'tests/**/*.{test,spec,property}.{ts,tsx}'
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.ts'],
exclude: ['src/**/*.test.ts', 'src/**/*.spec.ts', 'tests/**/*']
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@main': path.resolve(__dirname, './src/main'),
'@renderer': path.resolve(__dirname, './src/renderer'),
'@shared': path.resolve(__dirname, './src/shared'),
'@components': path.resolve(__dirname, './src/renderer/components'),
'@features': path.resolve(__dirname, './src/renderer/features'),
'@services': path.resolve(__dirname, './src/renderer/services'),
'@store': path.resolve(__dirname, './src/renderer/store'),
'@hooks': path.resolve(__dirname, './src/renderer/hooks'),
'@utils': path.resolve(__dirname, './src/renderer/utils'),
'@app-types': path.resolve(__dirname, './src/renderer/types'),
}
}
})