🔖 Checkpoint: Edit /workspaces/claude-code-flow/test-app/tests/smoke/test.js

This commit is contained in:
rUv committed 2025-08-16 16:39:31 +00:00
1 parent 3820116c83
commit 3e65edce14
3 files changed
+67

No files matched your search

+1
View File
@@ -0,0 +1 @@
{"branch": "checkpoint/pre-edit-20250816-163925", "file": "/workspaces/claude-code-flow/test-app/config/config.js", "timestamp": "2025-08-16T16:39:25Z", "type": "pre-edit", "original_branch": "alpha90"}
+1
View File
@@ -0,0 +1 @@
{"tag": "checkpoint-20250816-163927", "file": "/workspaces/claude-code-flow/test-app/config/config.js", "timestamp": "2025-08-16T16:39:27Z", "type": "post-edit", "branch": "alpha90", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/1755362362.json | 1 + .claude/checkpoints/1755362364.json | 1 + claude-flow-wiki | 0 test-app/config/config.js | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) "}
+65
View File
@@ -0,0 +1,65 @@
// Smoke test for the application
const { spawn } = require('child_process');
const path = require('path');
console.log('Running smoke tests...\n');
// Test 1: Verify the application runs
function testApplicationRuns() {
return new Promise((resolve, reject) => {
const appPath = path.join(__dirname, '../../src/index.js');
const child = spawn('node', [appPath]);
let output = '';
child.stdout.on('data', (data) => {
output += data.toString();
});
child.stderr.on('data', (data) => {
console.error('Error:', data.toString());
reject(new Error('Application produced error output'));
});
child.on('close', (code) => {
if (code !== 0) {
reject(new Error(`Application exited with code ${code}`));
} else if (output.includes('test')) {
console.log('✅ Test 1 Passed: Application runs and outputs "test"');
resolve();
} else {
reject(new Error('Application did not output "test"'));
}
});
});
}
// Test 2: Verify configuration loading
function testConfigurationLoading() {
try {
const config = require('../../config/config');
if (config && config.NODE_ENV) {
console.log('✅ Test 2 Passed: Configuration loads successfully');
return Promise.resolve();
} else {
return Promise.reject(new Error('Configuration did not load properly'));
}
} catch (error) {
return Promise.reject(error);
}
}
// Run all tests
async function runTests() {
try {
await testApplicationRuns();
await testConfigurationLoading();
console.log('\n🎉 All smoke tests passed!');
process.exit(0);
} catch (error) {
console.error('\n❌ Test failed:', error.message);
process.exit(1);
}
}
runTests();