mirror of
https://github.com/Heretek-AI/heretek-openclaw.git
synced 2026-07-01 12:23:18 -04:00
9d2c032f3c
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
40 lines
1.1 KiB
TypeScript
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'; |