Updated smoke-test.mjs with 55 additions
--- a/smoke-test.mjs
+++ b/smoke-test.mjs
@@ -1,0 +1,55 @@
+import { execSync } from 'child_process';
+import { readFileSync, unlinkSync, existsSync } from 'fs';
+import path from 'path';
+
+const DB_FILE = path.join(process.cwd(), 'tasks.json');
+
+function runCLI(args) {
+  return execSync(`node index.js ${args.join(' ')}`, { encoding: 'utf8' }).trim();
+}
+
+function setupTest() {
+  if (existsSync(DB_FILE)) {
+    unlinkSync(DB_FILE);
+  }
+}
+
+console.log('Running smoke tests...');
+
+setupTest();
+
+// Test 1: Add a task
+console.log('Adding task: "Buy groceries"');
+let output = runCLI(['add', 'Buy groceries']);
+console.assert(output === 'Task added: "Buy groceries"', `Test 1 Failed: ${output}`);
+
+// Test 2: List tasks
+console.log('Listing tasks...');
+output = runCLI(['list']);
+console.assert(output.includes('1. [ ] Buy groceries'), `Test 2 Failed: ${output}`);
+
+// Test 3: Complete a task
+console.log('Completing task 1...');
+output = runCLI(['complete', '1']);
+console.assert(output === 'Task 1 marked as complete.', `Test 3 Failed: ${output}`);
+
+// Test 4: List tasks (should be completed)
+console.log('Listing tasks (should be completed)...');
+output = runCLI(['list']);
+console.assert(output.includes('1. [x] Buy groceries'), `Test 4 Failed: ${output}`);
+
+// Test 5: Remove a task
+console.log('Removing task 1...');
+output = runCLI(['remove', '1']);
+console.assert(output === 'Task 1 removed.', `Test 5 Failed: ${output}`);
+
+// Test 6: List tasks (should be empty)
+console.log('Listing tasks (should be empty)...');
+output = runCLI(['list']);
+console.assert(output === 'No tasks found.', `Test 6 Failed: ${output}`);
+
+console.log('All smoke tests passed!');
+
+// Clean up
+setupTest();
+