vscode-maven/test/index.ts

43 строки
1.4 KiB
TypeScript
Исходник Обычный вид История

2022-06-22 05:18:24 +03:00
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
2022-06-27 09:31:37 +03:00
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from "@vscode/test-electron";
2022-06-22 05:18:24 +03:00
import * as cp from "child_process";
import * as os from "os";
import * as path from "path";
async function main(): Promise<void> {
try {
const vscodeExecutablePath = await downloadAndUnzipVSCode();
2022-06-27 09:31:37 +03:00
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java'], {
encoding: 'utf-8',
stdio: 'inherit'
2022-06-22 05:18:24 +03:00
});
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath: string = path.resolve(__dirname, "../../");
// Run test for maven project
await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath: path.resolve(__dirname, "./maven-suite"),
launchArgs: [
path.join(__dirname, "..", "..", "test", "projects", "maven"),
"--disable-workspace-trust",
],
});
process.exit(0);
} catch (err) {
process.stdout.write(`${err}${os.EOL}`);
process.exit(1);
}
}
main();