@vscode/test-electron
Advanced tools
Comparing version 1.6.2 to 2.0.0
# Changelog | ||
### 2.0.0 | 2021-12-14 | ||
- Run tests using a separate instance of VS Code by default. This can be disabled by setting `reuseMachineInstall: true`. | ||
### 1.6.2 | 2021-07-15 | ||
@@ -4,0 +8,0 @@ |
export declare function rmdir(dir: string): Promise<void>; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -13,2 +13,3 @@ /** | ||
} | ||
export declare const defaultCachePath: string; | ||
/** | ||
@@ -15,0 +16,0 @@ * Download and unzip a copy of VS Code. |
@@ -7,3 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.downloadAndUnzipVSCode = exports.download = void 0; | ||
exports.downloadAndUnzipVSCode = exports.download = exports.defaultCachePath = void 0; | ||
const fs = require("fs"); | ||
@@ -132,2 +132,3 @@ const path = require("path"); | ||
} | ||
exports.defaultCachePath = path.resolve(extensionRoot, '.vscode-test'); | ||
/** | ||
@@ -140,4 +141,4 @@ * Download and unzip a copy of VS Code. | ||
let version = options === null || options === void 0 ? void 0 : options.version; | ||
let platform = (_a = options === null || options === void 0 ? void 0 : options.platform) !== null && _a !== void 0 ? _a : util_1.systemDefaultPlatform; | ||
let cachePath = (_b = options === null || options === void 0 ? void 0 : options.cachePath) !== null && _b !== void 0 ? _b : path.resolve(extensionRoot, '.vscode-test'); | ||
const platform = (_a = options === null || options === void 0 ? void 0 : options.platform) !== null && _a !== void 0 ? _a : util_1.systemDefaultPlatform; | ||
const cachePath = (_b = options === null || options === void 0 ? void 0 : options.cachePath) !== null && _b !== void 0 ? _b : exports.defaultCachePath; | ||
if (version) { | ||
@@ -144,0 +145,0 @@ if (version === 'stable') { |
export { download, downloadAndUnzipVSCode } from './download'; | ||
export { runTests } from './runTest'; | ||
export { resolveCliPathFromVSCodeExecutablePath } from './util'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -31,2 +31,10 @@ import { DownloadVersion, DownloadPlatform } from './download'; | ||
/** | ||
* Whether VS Code should be launched using default settings and extensions | ||
* installed on this machine. If `false`, then separate directories will be | ||
* used inside the `.vscode-test` folder within the project. | ||
* | ||
* Defaults to `false`. | ||
*/ | ||
reuseMachineInstall?: boolean; | ||
/** | ||
* Absolute path to the extension root. Passed to `--extensionDevelopmentPath`. | ||
@@ -33,0 +41,0 @@ * Must include a `package.json` Extension Manifest. |
@@ -9,2 +9,3 @@ "use strict"; | ||
const cp = require("child_process"); | ||
const path = require("path"); | ||
const download_1 = require("./download"); | ||
@@ -23,2 +24,4 @@ /** | ||
'--no-sandbox', | ||
'--skip-welcome', | ||
'--skip-release-notes', | ||
'--disable-workspace-trust', | ||
@@ -31,5 +34,16 @@ '--extensionDevelopmentPath=' + options.extensionDevelopmentPath, | ||
} | ||
if (!options.reuseMachineInstall) { | ||
if (!hasArg('extensions-dir', args)) { | ||
args.push(`--extensions-dir=${path.join(download_1.defaultCachePath, 'extensions')}`); | ||
} | ||
if (!hasArg('user-data-dir', args)) { | ||
args.push(`--user-data-dir=${path.join(download_1.defaultCachePath, 'user-data')}`); | ||
} | ||
} | ||
return innerRunTests(options.vscodeExecutablePath, args, options.extensionTestsEnv); | ||
} | ||
exports.runTests = runTests; | ||
function hasArg(argName, argList) { | ||
return argList.some(a => a === `--${argName}` || a.startsWith(`--${argName}=`)); | ||
} | ||
async function innerRunTests(executable, args, testRunnerEnv) { | ||
@@ -36,0 +50,0 @@ return new Promise((resolve, reject) => { |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@vscode/test-electron", | ||
"version": "1.6.2", | ||
"version": "2.0.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "compile": "tsc -p ./", |
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
43993
705