-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-workflow-build.js
More file actions
31 lines (24 loc) · 1.13 KB
/
test-workflow-build.js
File metadata and controls
31 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
// Test script for workflow-build command
const { spawnSync } = require('child_process');
console.log('🧪 Testing workflow-build command...');
// Test 1: Show templates
const templatesResult = spawnSync('node', ['-e', `
const { workflowBuildCommand } = require('./dist/src/commands/workflow-ai-builder.js');
workflowBuildCommand.execute('template list', {}).then(console.log).catch(console.error);
`], { encoding: 'utf8' });
console.log('Template List Test:');
console.log(templatesResult.stdout || templatesResult.stderr);
// Test 2: Generate from template
const templateGenResult = spawnSync('node', ['-e', `
const { workflowBuildCommand } = require('./dist/src/commands/workflow-ai-builder.js');
workflowBuildCommand.execute('template deployment', {}).then(console.log).catch(console.error);
`], { encoding: 'utf8' });
console.log('Template Generation Test:');
console.log(templateGenResult.stdout || templateGenResult.stderr);
// List generated workflows
const fs = require('fs');
if (fs.existsSync('./workflows')) {
console.log('Generated workflows:');
console.log(fs.readdirSync('./workflows').join('\n'));
}