用途:在 VS Code 仓库中运行集成测试。集成测试分两类:src/ 下以 .integrationTest.ts 结尾的 Node.js 集成测试,通过 Electron 中与单元测试相同的 Mocha 运行器执行;以及 extensions/ 下内置扩展的扩展宿主测试(API、Git、TypeScript 等),会以 --extensionDevelopmentPath 启动完整 VS Code 实例。
运行方式:macOS/Linux 使用 ./scripts/test-integration.sh [options],Windows 使用 .\scripts/test-integration.bat [options]。无过滤参数时先跑全部 Node.js 集成测试再跑全部扩展宿主测试。
主要选项:--build 对 Node.js 集成测试改用 out-build/ 目录,但不编译;--run <file> 运行指定源文件(以 src/ 开头);--runGlob <pattern>(别名 --glob、--runGrep)按 glob 匹配编译后 .js 路径,仅对 Node.js 集成测试生效;--grep <pattern>(别名 -g、-f)按测试标题过滤,单独使用会作用于所有测试;--suite <pattern> 只运行匹配的扩展宿主套件(支持逗号分隔,macOS/Linux 支持 shell glob),跳过 Node.js 集成测试,可与 --grep 组合。可用套件名包括 api-folder、api-workspace、colorize、terminal-suggest、typescript、markdown、emmet、git、git-base、ipynb、notebook-renderers、configuration-editing、github-authentication、copilot、css、html、json。--help/-h 显示帮助。其他选项(--timeout、--coverage、--reporter 等)转发给 scripts/test.sh,但使用 --suite 时不转发给扩展宿主套件。
限制:测试运行在编译后的 JavaScript 上,需先完成编译或保持 VS Code - Build watch 任务运行。单元测试(.test.ts)应使用 scripts/test.sh 或 runTests 工具,二者不要混用;scripts/test.sh 不会自动找到集成测试文件,而 scripts/test-integration.sh 也不用于 .test.ts。资料未提供其他收费、平台或效果信息。