# 测试执行日志 ## 一、执行信息 | 项目 | 内容 | |---|---| | 执行日期 | 2026-08-26 | | 测试命令 | `npm test` | | 前置链路 | `lint 0 error → compile 通过 → compile:test 通过` | | 测试运行器 | `@vscode/test-cli`(.vscode-test.mjs:`out/tests/**/*.test.js`) | | 插件版本 | 1.3.0 | | 测试文件数 | 16 个 `*.test.ts` | ## 二、执行结果摘要 | 指标 | 结果 | |---|---| | 通过(passing) | **116** | | 失败(failing) | 0 | | 跳过(pending) | 0 | | 运行时长 | ~5s(Extension Host 退出码 0) | > 详细逐条用例清单见 `tests/test-cases.md`。 ## 三、运行环境 | 项目 | 内容 | |---|---| | 测试宿主 | VSCode Extension Test Host(@vscode/test-electron) | | 操作系统 | Windows(win32) | | Node.js | 插件 devDependencies 锁定版本(@types/node 22.x) | | 编译 | `tsc -p ./` + `node scripts/copy-webview-js.mjs`(主工程);`tsc -p ./tsconfig.test.json`(测试工程) | | Lint | `eslint src`:0 error(仅 `src/utils/mockDocument.ts` 2 处既有 curly warning) | ## 四、复现方式 ```bash npm run lint # eslint src → 0 error npm run compile # tsc 主工程 npm run compile:test # tsc 测试工程(out/tests) npm test # @vscode/test-cli 运行 out/tests/**/*.test.js ``` ## 五、覆盖率执行记录(2026-08-27) | 项目 | 内容 | |---|---| | 执行日期 | 2026-08-27 | | 测试命令 | `npm run test:coverage`(compile → compile:test → `vscode-test --coverage --coverage-output tests/coverage`) | | 测试文件数 | 24 个 `*.test.ts` | | 通过(passing) | **179** | | 失败(failing) | 0 | | 行/语句覆盖率 | **48.24%**(5570/11546) | | 分支覆盖率 | 77.97%(524/672) | | 函数覆盖率 | 43.66%(155/355) | | 覆盖率报告 | `tests/coverage/index.html`(仅统计测试实际触达模块) | | 新增覆盖模块 | jsp-extractor、report、method-extractor、fix-prompt、registry、ai/providers(三协议)、import-service、yaml-parser | > 覆盖率基线:2026-08-27 首跑 116 passing / 42.58% → 补测 63 条后 179 passing / 48.24%。