diff --git a/.claude/checkpoints/1755362365.json b/.claude/checkpoints/1755362365.json new file mode 100644 index 0000000000..e557246d8b --- /dev/null +++ b/.claude/checkpoints/1755362365.json @@ -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"} diff --git a/.claude/checkpoints/1755362367.json b/.claude/checkpoints/1755362367.json new file mode 100644 index 0000000000..575e55af89 --- /dev/null +++ b/.claude/checkpoints/1755362367.json @@ -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(-) "} diff --git a/test-app/tests/smoke/test.js b/test-app/tests/smoke/test.js new file mode 100644 index 0000000000..c3c91940e4 --- /dev/null +++ b/test-app/tests/smoke/test.js @@ -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(); \ No newline at end of file