forked from redhat-developer/vscode-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestRunner.ts
More file actions
39 lines (35 loc) · 1.57 KB
/
testRunner.ts
File metadata and controls
39 lines (35 loc) · 1.57 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
/* --------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as path from 'path';
import * as cp from 'child_process';
import { runTests, downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath } from 'vscode-test';
async function main(): Promise<void> {
try {
const executable = await downloadAndUnzipVSCode();
const cliPath = resolveCliPathFromVSCodeExecutablePath(executable);
const dependencies = ['redhat.vscode-commons'];
for (const dep of dependencies) {
const installLog = cp.execSync(`"${cliPath}" --install-extension ${dep}`);
console.log(installLog.toString());
}
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');
// Download VS Code, unzip it and run the integration test
await runTests({
vscodeExecutablePath: executable,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ['--disable-extension=ms-kubernetes-tools.vscode-kubernetes-tools', '.'],
});
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
main();