forked from microsoft/vscode-pull-request-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunTests.ts
More file actions
47 lines (40 loc) · 1.6 KB
/
Copy pathrunTests.ts
File metadata and controls
47 lines (40 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { existsSync } from 'fs';
import * as path from 'path';
import { downloadAndUnzipVSCode, runTests } from '@vscode/test-electron';
async function downloadVSCodeInsiders(): Promise<string> {
const vscodeExecutablePath = await downloadAndUnzipVSCode('insiders');
if (process.platform !== 'darwin' || existsSync(vscodeExecutablePath)) {
return vscodeExecutablePath;
}
// VS Code for macOS no longer keeps the legacy Electron executable name.
const renamedExecutablePath = path.join(path.dirname(vscodeExecutablePath), 'Code - Insiders');
if (existsSync(renamedExecutablePath)) {
return renamedExecutablePath;
}
throw new Error(`VS Code executable not found at ${vscodeExecutablePath} or ${renamedExecutablePath}`);
}
async function go() {
try {
const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
const extensionTestsPath = path.resolve(__dirname, './');
const vscodeExecutablePath = await downloadVSCodeInsiders();
console.log(extensionDevelopmentPath, extensionTestsPath);
/**
* Basic usage
*/
await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ['--disable-extensions'],
});
} catch (e) {
console.log(e);
process.exit(1);
}
}
setTimeout(() => go(), 10000);