@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
42 lines โข 1.58 kB
JavaScript
import { validateTemplate, formatResults } from './validate-metrics-scope';
import * as fs from 'fs';
console.log('๐งช Testing Orchestration Template Validator\n');
const testFiles = [
{
name: 'Invalid Campaign (visitor scope)',
file: './src/cli/poc/test-invalid-campaign.json',
shouldPass: false
},
{
name: 'Valid Campaign (session scope)',
file: './src/cli/poc/test-valid-campaign.json',
shouldPass: true
},
{
name: 'Mixed Entities (2 errors expected)',
file: './src/cli/poc/test-mixed-entities.json',
shouldPass: false
}
];
for (const test of testFiles) {
console.log(`\n๐ Testing: ${test.name}`);
console.log(` File: ${test.file}`);
console.log(` Expected: ${test.shouldPass ? 'PASS' : 'FAIL'}`);
console.log(' ' + 'โ'.repeat(50));
try {
const template = JSON.parse(fs.readFileSync(test.file, 'utf8'));
const result = validateTemplate(template);
console.log(formatResults(result));
const actualPass = result.valid;
const testPassed = actualPass === test.shouldPass;
console.log(`\n Test Result: ${testPassed ? 'โ
CORRECT' : 'โ INCORRECT'}`);
}
catch (error) {
console.error(` โ Error: ${error.message}`);
}
}
console.log('\n' + '='.repeat(60));
console.log('โจ POC Validation Complete!');
console.log('The orchestration rules layer is working correctly.');
console.log('Next step: Build the full TemplateValidator class.');
//# sourceMappingURL=test-validator.js.map