seogeneratorserver/tests/llm/llmmanager.timeout.test.js
StillHammer dbf1a3de8c Add technical plan for multi-format export system
Added plan.md with complete architecture for format-agnostic content generation:
- Support for Markdown, HTML, Plain Text, JSON formats
- New FormatExporter module with neutral data structure
- Integration strategy with existing ContentAssembly and ArticleStorage
- Bonus features: SEO metadata generation, readability scoring, WordPress Gutenberg format
- Implementation roadmap with 4 phases (6h total estimated)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 16:14:29 +08:00

26 lines
905 B
JavaScript

import test from 'node:test';
import assert from 'node:assert';
import { safeImport } from '../_helpers/path.js';
import { FakeLLMClient } from '../_helpers/fakeLLMClient.js';
function skip(msg){ console.warn('[SKIP]', msg); }
test('LLMManager: supports abort/timeout behavior', async () => {
const res = await safeImport('LLMManager');
if (!res.ok) { skip(res.reason); return; }
const L = res.mod;
if (typeof L.__setClient !== 'function') { skip('Missing __setClient'); return; }
const fake = new FakeLLMClient({ delayMs: 200 });
L.__setClient('mock', fake);
const ac = new AbortController();
const p = L.callModel({ provider:'mock', model:'fake-1', input:'slow', abortSignal: ac.signal });
setTimeout(()=> ac.abort(), 50);
let aborted = false;
try { await p; } catch(e){ aborted = true; }
assert.ok(aborted, 'expected abort to be propagated');
});