seo-generator-server/tests/debug-single-ti.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

52 lines
1.6 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';
/**
* TEST DEBUG - UN SEUL TEST TI POUR IDENTIFIER BLOCAGES
*/
const mockContent = {
'Titre_H1': 'Test titre simple avec du contenu générique qui va déclencher analyse technique',
'Contenu_Principal': 'Test contenu basique avec des termes génériques et du vocabulaire qui nécessite amélioration technique spécialisée avec des mots comme optimal et efficace',
'Introduction': 'Introduction générique qui peut être améliorée techniquement',
'Conclusion': 'Conclusion basique qui nécessite enhancement technique'
};
const mockCsvData = {
mc0: 'test debug',
personality: {
nom: 'Marc',
style: 'technique'
}
};
// Auto-Reporter Configuration
const autoReporter = new AutoReporter();
test('DEBUG: Single lightEnhancement test', { timeout: 60000 }, async () => {
console.log('🔍 Début test debug lightEnhancement...');
const { applyPredefinedStack } = requireCommonJS('selective-enhancement/SelectiveLayers');
console.log('✅ Module chargé, début appel...');
const startTime = Date.now();
const result = await applyPredefinedStack(mockContent, 'lightEnhancement', {
csvData: mockCsvData,
analysisMode: true
});
const duration = Date.now() - startTime;
console.log(`✅ Test terminé en ${duration}ms`);
console.log(`📊 Résultat:`, result?.stats || 'Pas de stats');
assert.ok(result, 'Résultat obtenu');
assert.ok(result.content, 'Contenu généré');
console.log('🎉 Test DEBUG réussi !');
});