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>
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
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: callModel happy path (mock client)', async () => {
|
|
const res = await safeImport('LLMManager');
|
|
if (!res.ok) { skip(res.reason); return; }
|
|
const L = res.mod;
|
|
|
|
// Hooks requis pour injection
|
|
if (typeof L.__setClient !== 'function' || typeof L.callModel !== 'function') {
|
|
skip('LLMManager test hooks not found (__setClient) or callModel missing');
|
|
return;
|
|
}
|
|
|
|
const fake = new FakeLLMClient({ delayMs: 5, prefix: 'TEST' });
|
|
L.__setClient('mock', fake);
|
|
|
|
const out = await L.callModel({ provider:'mock', model:'fake-1', input:'Hello' });
|
|
assert.ok(out);
|
|
const text = out.completion || out.text || out.output;
|
|
assert.equal(typeof text, 'string');
|
|
assert.ok(/TEST\[fake-1\]::/.test(text), 'completion should come from fake client');
|
|
});
|