-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathrunTest.ts
48 lines (43 loc) · 1.77 KB
/
runTest.ts
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
48
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
import * as cp from 'child_process';
import * as path from 'path';
async function main(): Promise<void> {
try {
const vscodeExecutablePath = await downloadAndUnzipVSCode('stable');
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
cp.spawnSync(
cli,
[
...args,
'--install-extension', 'ms-vscode.azure-account',
'--install-extension', 'ms-azuretools.vscode-azureresourcegroups',
'--install-extension', 'ms-python.python',
],
{
encoding: 'utf-8',
stdio: 'inherit'
});
const repoRoot: string = path.resolve(__dirname, '..', '..');
await runTests({
vscodeExecutablePath,
extensionDevelopmentPath: repoRoot,
launchArgs: [
path.resolve(repoRoot, 'test', 'test.code-workspace'),
'--disable-workspace-trust'
],
extensionTestsPath: path.resolve(repoRoot, 'dist', 'test', 'index'),
extensionTestsEnv: {
DEBUGTELEMETRY: 'v',
MOCHA_timeout: '20000'
}
});
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
void main();