From 9c5f485f65a9e669418b9fa7443d99ca33372304 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Mon, 3 Aug 2026 11:07:14 +0800 Subject: [PATCH] fix(ci): upgrade @vscode/test-electron to fix macOS test failures The macOS job fails on every run while Linux and Windows pass, dying immediately after the VS Code download with: Test error: Error: spawn .../Visual Studio Code.app/Contents/MacOS/Electron ENOENT Error: Test run failed with code -2 VS Code 1.110 renamed the macOS main binary inside the app bundle from `Electron` to the product name (`Code`), keeping a compatibility symlink under the old name. That symlink was removed in microsoft/vscode#326502, so every 1.110+ archive now fails to launch. The test runner does not pin a VS Code version, so it resolves the latest release (1.131.0) and hits this. Only macOS goes through that code path, which is why the other platforms pass. `@vscode/test-electron` ^2.5.2 hardcodes the old path, so the breakage surfaced as soon as the symlink went away. 3.1.0 resolves the executable via `CFBundleExecutable` from `Info.plist`, with a fallback to the sole regular file in `Contents/MacOS/` and finally the legacy `Electron` name, so both the new and pre-1.110 layouts work. `skipLibCheck` is enabled alongside the bump. 3.1.0 ships declarations that use the generic `Buffer`, which this repo's TypeScript 4.9 and older `@types/node` cannot resolve, so the upgrade otherwise fails to compile with `TS2315: Type 'Buffer' is not generic`. Raising `@types/node` instead was tried and pulls in unrelated type breakage, and sibling repos (vscode-java-dependency, vscode-spring-boot-dashboard) already set `skipLibCheck`, so this keeps the repos consistent. 3.x declares `engines.node >= 22` while CI runs Node 20, but this is a non-blocking `npm warn EBADENGINE`: the install succeeds, the package loads, and it uses no Node 22 only APIs. A Node bump is therefore left out to keep this change minimal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0b39911b-23b6-4180-ae96-2b6c06d2265b --- package-lock.json | 10 +++++----- package.json | 2 +- tsconfig.json | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8fabfa01..ff141b0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@types/vscode": "1.88.0", "@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/parser": "^5.60.1", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "eslint": "^8.43.0", "glob": "^7.2.3", "mocha": "^11.1.0", @@ -728,9 +728,9 @@ } }, "node_modules/@vscode/test-electron": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz", - "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.1.0.tgz", + "integrity": "sha512-CRqv5u+YYoseuNVJ6Tyo4k0sF0mx4qnKMihRB0PjsUF8Dc0WKtCXo6CNL6nWWm5esfFQsQA/pejMj4ZbpJVLTw==", "dev": true, "license": "MIT", "dependencies": { @@ -741,7 +741,7 @@ "semver": "^7.6.2" }, "engines": { - "node": ">=16" + "node": ">=22" } }, "node_modules/@webassemblyjs/ast": { diff --git a/package.json b/package.json index 57d01fcd..3df9e8b4 100644 --- a/package.json +++ b/package.json @@ -562,7 +562,7 @@ "@types/vscode": "1.88.0", "@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/parser": "^5.60.1", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "eslint": "^8.43.0", "glob": "^7.2.3", "mocha": "^11.1.0", diff --git a/tsconfig.json b/tsconfig.json index 5cebac91..cab52d26 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "noImplicitReturns": true, "noUnusedParameters": true, "strictNullChecks": true, - "alwaysStrict": true + "alwaysStrict": true, + "skipLibCheck": true }, "exclude": [ "node_modules",