UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

42 lines โ€ข 1.58 kB
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