()
| 188 | |
| 189 | // 运行调试测试 |
| 190 | async function runDebugTests() { |
| 191 | const tester = new DebugTester(); |
| 192 | |
| 193 | try { |
| 194 | await tester.init(); |
| 195 | |
| 196 | // 测试搜索功能 - 用你想要的查询 |
| 197 | await tester.testSearchFunction("透明 边框"); |
| 198 | await tester.testSearchFunction("border radius"); |
| 199 | await tester.testSearchFunction("镂空"); |
| 200 | |
| 201 | // 测试获取文章 |
| 202 | await tester.testSpecificArticle(1); |
| 203 | |
| 204 | // 测试分类 |
| 205 | await tester.testCategories(); |
| 206 | |
| 207 | console.log('\n🎉 All debug tests completed successfully!'); |
| 208 | |
| 209 | } catch (error) { |
| 210 | console.error('\n❌ Debug test failed:', error.message); |
| 211 | console.error(error.stack); |
| 212 | } finally { |
| 213 | tester.close(); |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | // 如果直接运行此脚本 |
| 218 | if (import.meta.url === `file://${process.argv[1]}`) { |
no test coverage detected