diff --git a/archon-ui-main/src/components/ui/TestResultDashboard.tsx b/archon-ui-main/src/components/ui/TestResultDashboard.tsx index a804a83c10..cbac555b0c 100644 --- a/archon-ui-main/src/components/ui/TestResultDashboard.tsx +++ b/archon-ui-main/src/components/ui/TestResultDashboard.tsx @@ -72,7 +72,7 @@ const TestSummaryCard: React.FC = ({ results, isLoading }) ); } - if (!results) { + if (!results || !results.summary) { return (
@@ -381,9 +381,9 @@ export const TestResultDashboard: React.FC = ({ )} {/* Main content */} -
+
{/* Test Summary */} -
+
diff --git a/archon-ui-main/vite.config.ts b/archon-ui-main/vite.config.ts index 0c812614b5..79909874c7 100644 --- a/archon-ui-main/vite.config.ts +++ b/archon-ui-main/vite.config.ts @@ -145,43 +145,34 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { mkdirSync(testResultsDir, { recursive: true }); } - const testProcess = exec('npm run test:coverage:stream', { + const testProcess = exec('npx vitest run --coverage --reporter=verbose --reporter=json', { cwd: process.cwd(), - env: { - ...process.env, - FORCE_COLOR: '1', + env: { + ...process.env, + FORCE_COLOR: '1', CI: 'true', - NODE_ENV: 'test' - } // Enable color output and CI mode for cleaner output + NODE_ENV: 'test', + } }); - testProcess.stdout?.on('data', (data) => { - const text = data.toString(); - // Split by newlines but preserve empty lines for better formatting - const lines = text.split('\n'); - - lines.forEach((line: string) => { - // Strip ANSI escape codes to get clean text - const cleanLine = line.replace(/\\x1b\[[0-9;]*m/g, ''); + const handleStream = (stream: any, res: any) => { + stream.on('data', (data: any) => { + const text = data.toString(); + const lines = text.split('\n'); - // Send all lines for verbose reporter output - res.write(`data: ${JSON.stringify({ type: 'output', message: cleanLine, timestamp: new Date().toISOString() })}\n\n`); - }); - - // Flush the response to ensure immediate delivery - if (res.flushHeaders) { - res.flushHeaders(); - } - }); + lines.forEach((line: string) => { + const cleanLine = line.replace(/\x1b\[[0-9;]*m/g, ''); + res.write(`data: ${JSON.stringify({ type: 'output', message: cleanLine, timestamp: new Date().toISOString() })}\n\n`); + }); - testProcess.stderr?.on('data', (data) => { - const lines = data.toString().split('\n').filter((line: string) => line.trim()); - lines.forEach((line: string) => { - // Strip ANSI escape codes - const cleanLine = line.replace(/\\x1b\[[0-9;]*m/g, ''); - res.write(`data: ${JSON.stringify({ type: 'output', message: cleanLine, timestamp: new Date().toISOString() })}\n\n`); + if (res.flushHeaders) { + res.flushHeaders(); + } }); - }); + }; + + handleStream(testProcess.stdout, res); + handleStream(testProcess.stderr, res); testProcess.on('close', (code) => { res.write(`data: ${JSON.stringify({