-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-silent-scaffolding.js
More file actions
85 lines (70 loc) · 2.29 KB
/
test-silent-scaffolding.js
File metadata and controls
85 lines (70 loc) · 2.29 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env node
/**
* Test the silent scaffolding functionality
*/
const path = require('path');
const fs = require('fs-extra');
async function testSilentScaffolding() {
console.log('🧪 Testing silent scaffolding...\n');
try {
// Import the scaffolding service
const { ScaffoldingService } = require('./src/scaffold/index.js');
const scaffoldingService = new ScaffoldingService();
// Create test config
const configData = {
"project": {
"name": "Silent Test Agent",
"language": "javascript",
"default_llm_provider": "openai"
},
"agent": {
"stages": ["test_node"],
"subAgents": 0
},
"tools": [
{
"node_name": "test_node",
"selected": ["test_tool"]
}
],
"llm_nodes": [
{
"node_name": "test_node",
"model": {
"provider": "openai",
"name": "gpt-4"
}
}
]
};
// Test silent mode
const targetPath = path.join(process.cwd(), 'test-silent-agent');
// Clean up any existing test directory
if (await fs.pathExists(targetPath)) {
await fs.remove(targetPath);
}
console.log('Generating project in silent mode...');
console.log('(No verbose output should appear below)');
console.log('---');
// Generate the project in silent mode
await scaffoldingService.generateProject(configData, targetPath, { silent: true });
console.log('---');
console.log('✅ Silent scaffolding completed successfully!');
// Verify the project was created
const projectExists = await fs.pathExists(targetPath);
const packageJsonExists = await fs.pathExists(path.join(targetPath, 'package.json'));
console.log(`\n📋 Verification:`);
console.log(` Project directory exists: ${projectExists ? '✅' : '❌'}`);
console.log(` Package.json exists: ${packageJsonExists ? '✅' : '❌'}`);
if (projectExists && packageJsonExists) {
console.log(`\n✅ Silent scaffolding test passed!`);
} else {
console.log(`\n❌ Silent scaffolding test failed`);
}
} catch (error) {
console.error(`\n❌ Test failed: ${error.message}`);
process.exit(1);
}
}
// Run the test
testSilentScaffolding();