- Add intermediate saves (v1.0-v1.4) to Generated_Articles_Versioned - Fix compiled_text pipeline (generatedTexts object structure) - Add /api/workflow-modulaire endpoint with version tracking - Create test-modulaire.html interface with real-time logs - Support parent-child linking via Parent_Article_ID
167 lines
5.3 KiB
JavaScript
167 lines
5.3 KiB
JavaScript
// ========================================
|
|
// TESTS GÉNÉRÉS AUTOMATIQUEMENT - demo-modulaire
|
|
// Module: selective-enhancement/demo-modulaire.js
|
|
// Générés le: 2025-09-06T03:38:48.274Z
|
|
// ========================================
|
|
|
|
const assert = require('assert');
|
|
const { test, describe } = require('node:test');
|
|
const demo-modulaire = require('../../selective-enhancement/demo-modulaire.js');
|
|
|
|
describe('demo-modulaire - Tests automatiques', () => {
|
|
|
|
// Setup avant les tests
|
|
let testContext = {};
|
|
|
|
test('Module loading', () => {
|
|
assert.ok(demo-modulaire, 'Module should be loaded');
|
|
console.log('📦 Module demo-modulaire loaded successfully');
|
|
});
|
|
|
|
|
|
test('demoModularSelective - Async Operation', async () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const startTime = Date.now();
|
|
const result = await demo-modulaire.demoModularSelective(input);
|
|
const duration = Date.now() - startTime;
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(duration < 30000, 'Should complete within 30 seconds');
|
|
|
|
console.log(`✅ demoModularSelective: Completed in ${duration}ms`);
|
|
|
|
} catch (error) {
|
|
console.error('❌ demoModularSelective: Async operation failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('demoIntegrationExistante - Async Operation', async () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const startTime = Date.now();
|
|
const result = await demo-modulaire.demoIntegrationExistante(input);
|
|
const duration = Date.now() - startTime;
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(duration < 30000, 'Should complete within 30 seconds');
|
|
|
|
console.log(`✅ demoIntegrationExistante: Completed in ${duration}ms`);
|
|
|
|
} catch (error) {
|
|
console.error('❌ demoIntegrationExistante: Async operation failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('benchmarkPerformance - Async Operation', async () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const startTime = Date.now();
|
|
const result = await demo-modulaire.benchmarkPerformance(input);
|
|
const duration = Date.now() - startTime;
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(duration < 30000, 'Should complete within 30 seconds');
|
|
|
|
console.log(`✅ benchmarkPerformance: Completed in ${duration}ms`);
|
|
|
|
} catch (error) {
|
|
console.error('❌ benchmarkPerformance: Async operation failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('if - Basic Function', () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const result = demo-modulaire.if(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ if: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ if: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('catch - Basic Function', () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const result = demo-modulaire.catch(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ catch: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ catch: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('for - Basic Function', () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const result = demo-modulaire.for(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ for: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ for: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('Export - demoModularSelective', () => {
|
|
assert.ok(demo-modulaire.demoModularSelective !== undefined, 'Export demoModularSelective should be available');
|
|
console.log('✅ Export demoModularSelective: Available');
|
|
});
|
|
|
|
test('Export - demoIntegrationExistante', () => {
|
|
assert.ok(demo-modulaire.demoIntegrationExistante !== undefined, 'Export demoIntegrationExistante should be available');
|
|
console.log('✅ Export demoIntegrationExistante: Available');
|
|
});
|
|
|
|
test('Export - benchmarkPerformance', () => {
|
|
assert.ok(demo-modulaire.benchmarkPerformance !== undefined, 'Export benchmarkPerformance should be available');
|
|
console.log('✅ Export benchmarkPerformance: Available');
|
|
});
|
|
|
|
|
|
// Test d'intégration général
|
|
test('Integration - Module health check', async () => {
|
|
try {
|
|
// Vérification exports
|
|
const exports = Object.keys(demo-modulaire);
|
|
assert.ok(exports.length > 0, 'Module should export functions');
|
|
|
|
console.log(`✅ demo-modulaire: ${exports.length} exports available`);
|
|
console.log('📋 Exports:', exports.join(', '));
|
|
|
|
} catch (error) {
|
|
console.error('❌ Integration test failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
}); |