(testName, sql)
| 74 | } |
| 75 | |
| 76 | testQuery(testName, sql) { |
| 77 | return new Promise((resolve, reject) => { |
| 78 | this.db.all(sql, (err, rows) => { |
| 79 | if (err) { |
| 80 | console.error(`❌ ${testName} failed:`, err.message); |
| 81 | reject(err); |
| 82 | } else { |
| 83 | console.log(`✅ ${testName}: ${rows.length} results`); |
| 84 | if (rows.length > 0) { |
| 85 | console.log(' Sample results:'); |
| 86 | rows.slice(0, 2).forEach((row, index) => { |
| 87 | console.log(` ${index + 1}.`, Object.keys(row).slice(0, 3).map(key => |
| 88 | `${key}: ${String(row[key]).substring(0, 30)}` |
| 89 | ).join(', ')); |
| 90 | }); |
| 91 | } |
| 92 | console.log(''); |
| 93 | resolve(rows); |
| 94 | } |
| 95 | }); |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | async testCodeSnippets() { |
| 100 | console.log('🔍 Testing code snippets...\n'); |
no outgoing calls
no test coverage detected