@vscode/test-electron
Advanced tools
Comparing version 2.3.7 to 2.3.8
@@ -120,2 +120,12 @@ "use strict"; | ||
} | ||
function getFilename(contentDisposition) { | ||
const parts = contentDisposition.split(';').map((s) => s.trim()); | ||
for (const part of parts) { | ||
const match = /^filename="?([^"]*)"?$/i.exec(part); | ||
if (match) { | ||
return match[1]; | ||
} | ||
} | ||
return undefined; | ||
} | ||
/** | ||
@@ -129,3 +139,3 @@ * Download a copy of VS Code archive to `.vscode-test`. | ||
async function downloadVSCodeArchive(options) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (!fs.existsSync(options.cachePath)) { | ||
@@ -149,6 +159,7 @@ fs.mkdirSync(options.cachePath); | ||
const totalBytes = Number(download.headers['content-length']); | ||
const contentType = download.headers['content-type']; | ||
const isZip = contentType ? contentType === 'application/zip' : url.endsWith('.zip'); | ||
const contentDisposition = download.headers['content-disposition']; | ||
const fileName = contentDisposition ? getFilename(contentDisposition) : undefined; | ||
const isZip = (_b = fileName === null || fileName === void 0 ? void 0 : fileName.endsWith('zip')) !== null && _b !== void 0 ? _b : url.endsWith('.zip'); | ||
const timeoutCtrl = new request.TimeoutController(timeout); | ||
(_b = options.reporter) === null || _b === void 0 ? void 0 : _b.report({ | ||
(_c = options.reporter) === null || _c === void 0 ? void 0 : _c.report({ | ||
stage: progress_1.ProgressReportStage.Downloading, | ||
@@ -155,0 +166,0 @@ url, |
@@ -25,23 +25,25 @@ "use strict"; | ||
}); | ||
for (const platform of platforms) { | ||
vitest_1.test.concurrent(platform, async () => { | ||
const location = await download_1.downloadAndUnzipVSCode({ | ||
platform, | ||
version: 'stable', | ||
cachePath: testTempDir, | ||
reporter: new progress_1.SilentReporter(), | ||
for (const quality of ['insiders', 'stable']) { | ||
for (const platform of platforms) { | ||
vitest_1.test.concurrent(`${quality}/${platform}`, async () => { | ||
const location = await download_1.downloadAndUnzipVSCode({ | ||
platform, | ||
version: quality, | ||
cachePath: testTempDir, | ||
reporter: new progress_1.SilentReporter(), | ||
}); | ||
if (!fs_1.existsSync(location)) { | ||
throw new Error(`expected ${location} to exist for ${platform}`); | ||
} | ||
const exePath = util_1.resolveCliPathFromVSCodeExecutablePath(location, platform); | ||
if (!fs_1.existsSync(exePath)) { | ||
throw new Error(`expected ${exePath} to from ${location}`); | ||
} | ||
if (platform === util_1.systemDefaultPlatform) { | ||
const version = child_process_1.spawnSync(exePath, ['--version']); | ||
vitest_1.expect(version.status).to.equal(0); | ||
vitest_1.expect(version.stdout.toString().trim()).to.not.be.empty; | ||
} | ||
}); | ||
if (!fs_1.existsSync(location)) { | ||
throw new Error(`expected ${location} to exist for ${platform}`); | ||
} | ||
const exePath = util_1.resolveCliPathFromVSCodeExecutablePath(location, platform); | ||
if (!fs_1.existsSync(exePath)) { | ||
throw new Error(`expected ${exePath} to from ${location}`); | ||
} | ||
if (platform === util_1.systemDefaultPlatform) { | ||
const version = child_process_1.spawnSync(exePath, ['--version']); | ||
vitest_1.expect(version.status).to.equal(0); | ||
vitest_1.expect(version.stdout.toString().trim()).to.not.be.empty; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -57,3 +59,3 @@ vitest_1.afterAll(async () => { | ||
}); | ||
vitest_1.describe('fetchTargetInferredVersion', () => { | ||
vitest_1.describe.skip('fetchTargetInferredVersion', () => { | ||
let stable; | ||
@@ -60,0 +62,0 @@ let insiders; |
{ | ||
"name": "@vscode/test-electron", | ||
"version": "2.3.7", | ||
"version": "2.3.8", | ||
"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
84703
1484