Files
John Doe 9d2c032f3c merge(scripts): implement testing framework with unit, integration, E2E tests
Cycle 6 - Testing Framework:
- Create tests/vitest.config.ts: Vitest configuration
- Create tests/test-utils.ts: Shared test utilities
- Create tests/unit/health-check.test.ts: Unit tests for health check

Features:
- Vitest test runner configuration
- Coverage reporting with v8 provider
- Mock fetch utilities
- Helper functions for creating mock agents, sessions, messages
- Example unit tests for agent registry

Note: Install vitest with 'npm install -D vitest @vitest/coverage-v8'

Validation: Run 'npm test' after installing dependencies
2026-03-29 22:17:51 -04:00

40 lines
1.1 KiB
TypeScript

/**
* Heretek OpenClaw — Testing Framework Setup
* ==============================================================================
* Vitest configuration and test utilities
* ==============================================================================
*/
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Use Vitest globals for easier test writing
globals: true,
environment: 'node',
// Coverage settings
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: [
'web-interface/src/lib/server/**/*.ts',
'modules/**/*.js'
],
exclude: [
'**/*.test.ts',
'**/*.spec.ts',
'**/node_modules/**'
]
},
// Test timeouts
testTimeout: 10000,
// Watch mode for development
watch: process.env.NODE_ENV !== 'test'
}
});
// Re-export test utilities
export * from './test-utils';