From fbf75384ffaf0532b9e7909046d034d4b9f6802b Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Thu, 30 Jun 2022 14:51:42 +0800 Subject: [PATCH] chore(deps): Migrate to @vscode/test-electron (#1445) Signed-off-by: Sheng Chen --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- test/index.ts | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 01f40d1..4613816 100644 --- a/package-lock.json +++ b/package-lock.json @@ -343,6 +343,18 @@ "@microsoft/1ds-post-js": "^3.2.3" } }, + "@vscode/test-electron": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.5.tgz", + "integrity": "sha512-O/ioqFpV+RvKbRykX2ItYPnbcZ4Hk5V0rY4uhQjQTLhGL9WZUvS7exzuYQCCI+ilSqJpctvxq2llTfGXf9UnnA==", + "dev": true, + "requires": { + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "rimraf": "^3.0.2", + "unzipper": "^0.10.11" + } + }, "@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -2353,18 +2365,6 @@ "tas-client": "0.1.45" } }, - "vscode-test": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.6.1.tgz", - "integrity": "sha512-086q88T2ca1k95mUzffvbzb7esqQNvJgiwY4h29ukPhFo8u+vXOOmelUoU5EQUHs3Of8+JuQ3oGdbVCqaxuTXA==", - "dev": true, - "requires": { - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "rimraf": "^3.0.2", - "unzipper": "^0.10.11" - } - }, "watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/package.json b/package.json index 8424c0a..8e87080 100644 --- a/package.json +++ b/package.json @@ -408,13 +408,13 @@ "@types/node": "^14.18.20", "@types/sinon": "^10.0.11", "@types/vscode": "1.65.0", + "@vscode/test-electron": "^2.1.5", "glob": "^7.2.3", "mocha": "^9.2.2", "sinon": "^11.1.2", "ts-loader": "^9.3.0", "tslint": "^6.1.3", "typescript": "^4.7.3", - "vscode-test": "^1.6.1", "webpack": "^5.73.0", "webpack-cli": "^4.9.2" }, diff --git a/test/index.ts b/test/index.ts index a0e5ba5..19053ea 100644 --- a/test/index.ts +++ b/test/index.ts @@ -4,20 +4,20 @@ import * as cp from 'child_process'; import * as os from 'os'; import * as path from 'path'; -import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from 'vscode-test'; +import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron'; async function main(): Promise { try { const vscodeExecutablePath = await downloadAndUnzipVSCode(); - const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath); + const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); // Resolve redhat.java dependency - cp.spawnSync(cliPath, ['--install-extension', 'redhat.java'], { + cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java'], { encoding: 'utf-8', stdio: 'inherit', }); - cp.spawnSync(cliPath, ['--install-extension', 'vscjava.vscode-java-debug'], { + cp.spawnSync(cli, [...args, '--install-extension', 'vscjava.vscode-java-debug'], { encoding: 'utf-8', stdio: 'inherit', });