seo-generator-server/tests/simple-verification.test.js
StillHammer 4f60de68d6 Fix BatchProcessor initialization and add comprehensive test suite
- Fix BatchProcessor constructor to avoid server blocking during startup
- Add comprehensive integration tests for all modular combinations
- Enhance CLAUDE.md documentation with new test commands
- Update SelectiveLayers configuration for better LLM allocation
- Add AutoReporter system for test automation
- Include production workflow validation tests

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 14:17:49 +08:00

42 lines
1.2 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert';
import { requireCommonJS } from './_helpers/commonjs-bridge.js';
import { AutoReporter } from './reporters/AutoReporter.js';
/**
* SIMPLE VERIFICATION - Test que le système marche de bout en bout
*/
const autoReporter = new AutoReporter();
const mockCsvData = {
mc0: 'test simple',
t0: 'Test de vérification',
personality: {
nom: 'Marc',
style: 'technique'
}
};
const mockContent = {
'Titre_H1': 'Test simple pour vérifier le système'
};
test('Verification lightEnhancement', { timeout: 20000 }, async () => {
autoReporter.onTestStart('Verification lightEnhancement');
const { applyPredefinedStack } = requireCommonJS('selective-enhancement/SelectiveLayers');
const result = await applyPredefinedStack(mockContent, 'lightEnhancement', {
csvData: mockCsvData,
analysisMode: true
});
assert.ok(result, 'lightEnhancement doit retourner un résultat');
assert.ok(result['Titre_H1'], 'Le titre doit être amélioré');
});
test.after(() => {
console.log(`DEBUG: Tests capturés: ${autoReporter.testResults.length}`);
console.log(`DEBUG: LLM calls: ${autoReporter.llmCalls.length}`);
autoReporter.generateReport();
});