@vscode/test-electron
Advanced tools
Comparing version 2.4.0 to 2.4.1
# Changelog | ||
### 2.4.1 | 2024-07-05 | ||
- Throw a typed `TestRunFailedError` on failure instead of a string. | ||
### 2.4.0 | 2024-05-24 | ||
@@ -4,0 +8,0 @@ |
@@ -30,3 +30,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.downloadAndUnzipVSCode = exports.download = exports.defaultCachePath = exports.fetchTargetInferredVersion = exports.fetchInsiderVersions = exports.fetchStableVersions = void 0; | ||
exports.defaultCachePath = exports.fetchInsiderVersions = exports.fetchStableVersions = void 0; | ||
exports.fetchTargetInferredVersion = fetchTargetInferredVersion; | ||
exports.download = download; | ||
exports.downloadAndUnzipVSCode = downloadAndUnzipVSCode; | ||
const cp = __importStar(require("child_process")); | ||
@@ -97,3 +100,2 @@ const fs = __importStar(require("fs")); | ||
} | ||
exports.fetchTargetInferredVersion = fetchTargetInferredVersion; | ||
async function getEngineVersionFromExtension(extensionPath) { | ||
@@ -408,3 +410,2 @@ try { | ||
} | ||
exports.download = download; | ||
async function downloadAndUnzipVSCode(versionOrOptions, platform, reporter, extractSync) { | ||
@@ -415,2 +416,1 @@ return await download(typeof versionOrOptions === 'object' | ||
} | ||
exports.downloadAndUnzipVSCode = downloadAndUnzipVSCode; |
export { download, downloadAndUnzipVSCode, DownloadOptions } from './download'; | ||
export { runTests, TestOptions } from './runTest'; | ||
export { runTests, TestOptions, TestRunFailedError } from './runTest'; | ||
export { resolveCliPathFromVSCodeExecutablePath, resolveCliArgsFromVSCodeExecutablePath, runVSCodeCommand, VSCodeCommandError, RunVSCodeCommandOptions, } from './util'; | ||
export * from './progress.js'; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VSCodeCommandError = exports.runVSCodeCommand = exports.resolveCliArgsFromVSCodeExecutablePath = exports.resolveCliPathFromVSCodeExecutablePath = exports.runTests = exports.downloadAndUnzipVSCode = exports.download = void 0; | ||
exports.VSCodeCommandError = exports.runVSCodeCommand = exports.resolveCliArgsFromVSCodeExecutablePath = exports.resolveCliPathFromVSCodeExecutablePath = exports.TestRunFailedError = exports.runTests = exports.downloadAndUnzipVSCode = exports.download = void 0; | ||
var download_1 = require("./download"); | ||
@@ -28,2 +28,3 @@ Object.defineProperty(exports, "download", { enumerable: true, get: function () { return download_1.download; } }); | ||
Object.defineProperty(exports, "runTests", { enumerable: true, get: function () { return runTest_1.runTests; } }); | ||
Object.defineProperty(exports, "TestRunFailedError", { enumerable: true, get: function () { return runTest_1.TestRunFailedError; } }); | ||
var util_1 = require("./util"); | ||
@@ -30,0 +31,0 @@ Object.defineProperty(exports, "resolveCliPathFromVSCodeExecutablePath", { enumerable: true, get: function () { return util_1.resolveCliPathFromVSCodeExecutablePath; } }); |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" resolution-mode="import"/> | ||
import { IncomingMessage } from 'http'; | ||
@@ -3,0 +2,0 @@ export declare function getStream(api: string, timeout: number): Promise<IncomingMessage>; |
@@ -30,3 +30,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TimeoutError = exports.TimeoutController = exports.getJSON = exports.getStream = void 0; | ||
exports.TimeoutError = exports.TimeoutController = void 0; | ||
exports.getStream = getStream; | ||
exports.getJSON = getJSON; | ||
const https = __importStar(require("https")); | ||
@@ -44,3 +46,2 @@ const util_1 = require("./util"); | ||
} | ||
exports.getStream = getStream; | ||
async function getJSON(api, timeout) { | ||
@@ -79,3 +80,2 @@ const ctrl = new TimeoutController(timeout); | ||
} | ||
exports.getJSON = getJSON; | ||
class TimeoutController { | ||
@@ -82,0 +82,0 @@ get signal() { |
@@ -63,1 +63,6 @@ import { DownloadOptions } from './download'; | ||
export declare function runTests(options: TestOptions): Promise<number>; | ||
export declare class TestRunFailedError extends Error { | ||
readonly code: number | undefined; | ||
readonly signal: string | undefined; | ||
constructor(code: number | undefined, signal: string | undefined); | ||
} |
@@ -30,3 +30,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.runTests = void 0; | ||
exports.TestRunFailedError = void 0; | ||
exports.runTests = runTests; | ||
const cp = __importStar(require("child_process")); | ||
@@ -70,3 +71,2 @@ const download_1 = require("./download"); | ||
} | ||
exports.runTests = runTests; | ||
const SIGINT = 'SIGINT'; | ||
@@ -111,11 +111,7 @@ async function innerRunTests(executable, args, testRunnerEnv) { | ||
cmd.stderr.destroy(); | ||
if (code === null) { | ||
reject(signal); | ||
if (code !== 0) { | ||
reject(new TestRunFailedError(code ?? undefined, signal ?? undefined)); | ||
} | ||
else if (code !== 0) { | ||
reject('Failed'); | ||
} | ||
else { | ||
console.log('Done\n'); | ||
resolve(code ?? -1); | ||
resolve(0); | ||
} | ||
@@ -140,1 +136,9 @@ } | ||
} | ||
class TestRunFailedError extends Error { | ||
constructor(code, signal) { | ||
super(signal ? `Test run terminated with signal ${signal}` : `Test run failed with code ${code}`); | ||
this.code = code; | ||
this.signal = signal; | ||
} | ||
} | ||
exports.TestRunFailedError = TestRunFailedError; |
@@ -1,5 +0,1 @@ | ||
/// <reference types="node" resolution-mode="import"/> | ||
/// <reference types="node" resolution-mode="import"/> | ||
/// <reference types="node" resolution-mode="import"/> | ||
/// <reference types="node" resolution-mode="import"/> | ||
import { SpawnOptions } from 'child_process'; | ||
@@ -6,0 +2,0 @@ import * as https from 'https'; |
@@ -30,3 +30,21 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.killTree = exports.onceWithoutRejections = exports.isSubdirectory = exports.streamToBuffer = exports.validateStream = exports.isDefined = exports.runVSCodeCommand = exports.VSCodeCommandError = exports.hasArg = exports.getProfileArguments = exports.resolveCliArgsFromVSCodeExecutablePath = exports.resolveCliPathFromVSCodeExecutablePath = exports.getLatestInsidersMetadata = exports.getInsidersVersionMetadata = exports.insidersDownloadDirMetadata = exports.insidersDownloadDirToExecutablePath = exports.downloadDirToExecutablePath = exports.urlToOptions = exports.getVSCodeDownloadUrl = exports.Version = exports.systemDefaultPlatform = void 0; | ||
exports.VSCodeCommandError = exports.Version = exports.systemDefaultPlatform = void 0; | ||
exports.getVSCodeDownloadUrl = getVSCodeDownloadUrl; | ||
exports.urlToOptions = urlToOptions; | ||
exports.downloadDirToExecutablePath = downloadDirToExecutablePath; | ||
exports.insidersDownloadDirToExecutablePath = insidersDownloadDirToExecutablePath; | ||
exports.insidersDownloadDirMetadata = insidersDownloadDirMetadata; | ||
exports.getInsidersVersionMetadata = getInsidersVersionMetadata; | ||
exports.getLatestInsidersMetadata = getLatestInsidersMetadata; | ||
exports.resolveCliPathFromVSCodeExecutablePath = resolveCliPathFromVSCodeExecutablePath; | ||
exports.resolveCliArgsFromVSCodeExecutablePath = resolveCliArgsFromVSCodeExecutablePath; | ||
exports.getProfileArguments = getProfileArguments; | ||
exports.hasArg = hasArg; | ||
exports.runVSCodeCommand = runVSCodeCommand; | ||
exports.isDefined = isDefined; | ||
exports.validateStream = validateStream; | ||
exports.streamToBuffer = streamToBuffer; | ||
exports.isSubdirectory = isSubdirectory; | ||
exports.onceWithoutRejections = onceWithoutRejections; | ||
exports.killTree = killTree; | ||
const child_process_1 = require("child_process"); | ||
@@ -96,3 +114,2 @@ const crypto_1 = require("crypto"); | ||
} | ||
exports.getVSCodeDownloadUrl = getVSCodeDownloadUrl; | ||
let PROXY_AGENT = undefined; | ||
@@ -118,3 +135,2 @@ let HTTPS_PROXY_AGENT = undefined; | ||
} | ||
exports.urlToOptions = urlToOptions; | ||
function downloadDirToExecutablePath(dir, platform) { | ||
@@ -131,3 +147,2 @@ if (windowsPlatforms.has(platform)) { | ||
} | ||
exports.downloadDirToExecutablePath = downloadDirToExecutablePath; | ||
function insidersDownloadDirToExecutablePath(dir, platform) { | ||
@@ -144,3 +159,2 @@ if (windowsPlatforms.has(platform)) { | ||
} | ||
exports.insidersDownloadDirToExecutablePath = insidersDownloadDirToExecutablePath; | ||
function insidersDownloadDirMetadata(dir, platform) { | ||
@@ -163,3 +177,2 @@ let productJsonPath; | ||
} | ||
exports.insidersDownloadDirMetadata = insidersDownloadDirMetadata; | ||
async function getInsidersVersionMetadata(platform, version, released) { | ||
@@ -169,3 +182,2 @@ const remoteUrl = `https://update.code.visualstudio.com/api/versions/${version}/${platform}/insider?released=${released}`; | ||
} | ||
exports.getInsidersVersionMetadata = getInsidersVersionMetadata; | ||
async function getLatestInsidersMetadata(platform, released) { | ||
@@ -175,3 +187,2 @@ const remoteUrl = `https://update.code.visualstudio.com/api/update/${platform}/insider/latest?released=${released}`; | ||
} | ||
exports.getLatestInsidersMetadata = getLatestInsidersMetadata; | ||
/** | ||
@@ -205,3 +216,2 @@ * Resolve the VS Code cli path from executable path returned from `downloadAndUnzipVSCode`. | ||
} | ||
exports.resolveCliPathFromVSCodeExecutablePath = resolveCliPathFromVSCodeExecutablePath; | ||
/** | ||
@@ -235,3 +245,2 @@ * Resolve the VS Code cli arguments from executable path returned from `downloadAndUnzipVSCode`. | ||
} | ||
exports.resolveCliArgsFromVSCodeExecutablePath = resolveCliArgsFromVSCodeExecutablePath; | ||
/** Adds the extensions and user data dir to the arguments for the VS Code CLI */ | ||
@@ -248,7 +257,5 @@ function getProfileArguments(args) { | ||
} | ||
exports.getProfileArguments = getProfileArguments; | ||
function hasArg(argName, argList) { | ||
return argList.some((a) => a === `--${argName}` || a.startsWith(`--${argName}=`)); | ||
} | ||
exports.hasArg = hasArg; | ||
class VSCodeCommandError extends Error { | ||
@@ -302,3 +309,2 @@ constructor(args, exitCode, stderr, stdout) { | ||
} | ||
exports.runVSCodeCommand = runVSCodeCommand; | ||
/** Predicates whether arg is undefined or null */ | ||
@@ -308,3 +314,2 @@ function isDefined(arg) { | ||
} | ||
exports.isDefined = isDefined; | ||
/** | ||
@@ -337,3 +342,2 @@ * Validates the stream data matches the given length and checksum, if any. | ||
} | ||
exports.validateStream = validateStream; | ||
/** Gets a Buffer from a Node.js stream */ | ||
@@ -348,3 +352,2 @@ function streamToBuffer(readable) { | ||
} | ||
exports.streamToBuffer = streamToBuffer; | ||
/** Gets whether child is a subdirectory of the parent */ | ||
@@ -355,3 +358,2 @@ function isSubdirectory(parent, child) { | ||
} | ||
exports.isSubdirectory = isSubdirectory; | ||
/** | ||
@@ -373,3 +375,2 @@ * Wraps a function so that it's called once, and never again, memoizing | ||
} | ||
exports.onceWithoutRejections = onceWithoutRejections; | ||
function killTree(processId, force) { | ||
@@ -393,2 +394,1 @@ let cp; | ||
} | ||
exports.killTree = killTree; |
{ | ||
"name": "@vscode/test-electron", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"scripts": { | ||
@@ -27,3 +27,3 @@ "compile": "tsc -p ./", | ||
"http-proxy-agent": "^7.0.2", | ||
"https-proxy-agent": "^7.0.4", | ||
"https-proxy-agent": "^7.0.5", | ||
"jszip": "^3.10.1", | ||
@@ -34,12 +34,12 @@ "ora": "^7.0.1", | ||
"devDependencies": { | ||
"@eslint/js": "^9.3.0", | ||
"@types/node": "^18", | ||
"@types/rimraf": "^3.0.0", | ||
"@types/semver": "^7.3.13", | ||
"eslint": "^9.3.0", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^13.1.2", | ||
"prettier": "^2.8.4", | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.10.0", | ||
"@eslint/js": "^9.6.0", | ||
"@types/node": "^20", | ||
"@types/rimraf": "^3.0.2", | ||
"@types/semver": "^7.5.8", | ||
"eslint": "^8.56.0", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.7", | ||
"prettier": "^3.3.2", | ||
"typescript": "^5.5.3", | ||
"typescript-eslint": "^7.15.0", | ||
"vitest": "^1.6.0" | ||
@@ -46,0 +46,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1675
93500
Updatedhttps-proxy-agent@^7.0.5