Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main(): Promise {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath: string = path.resolve(__dirname, '../../');
const vscodeExecutablePath: string = await downloadAndUnzipVSCode('stable');
const cliPath: string = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
cp.spawnSync(cliPath, ['--install-extension', 'redhat.java'], {
encoding: 'utf-8',
stdio: 'inherit',
});
cp.spawnSync(cliPath, ['--install-extension', 'vscjava.vscode-java-debug'], {
encoding: 'utf-8',
stdio: 'inherit',
});
// Run Maven JUnit 4 Code Lens tests
await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath: path.resolve(__dirname, './maven-junit4-suite'),
if (process.env.VERSION) {
version = process.env.VERSION;
}
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath: string = path.resolve(__dirname, '..', '..');
// The path to the extension test runner script
// Passed to --extensionTestsPath
const extensionTestsPath: string = path.resolve(__dirname);
const workspacePath: string = path.resolve(__dirname, '..', '..', 'cucumber', 'data', 'cucumber.code-workspace');
const vscodeExecutablePath: string = await downloadAndUnzipVSCode(version);
const cliPath: string = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
// Use cp.spawn / cp.exec for custom setup
cp.spawnSync(cliPath, ['--install-extension', 'oshri6688.javascript-test-runner'], {
encoding: 'utf-8',
stdio: 'inherit'
});
// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [workspacePath],
version: version
});
} catch (err) {
// tslint:disable-next-line: no-console
}
ltexDirPath = Path.resolve(__dirname, '..', '..');
let codeVersion: string = 'stable';
let codePlatform: string | undefined;
if (process.platform == 'win32') {
codeVersion = '1.35.1';
codePlatform = 'win32-x64-archive';
}
console.log('Downloading and installing VS Code...');
vscodeExecutablePath = await CodeTest.downloadAndUnzipVSCode(codeVersion, codePlatform);
console.log('Resolving CLI path to VS Code...');
cliPath = CodeTest.resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
for (let testIteration: number = 0; testIteration < 4; testIteration++) {
if (fastMode && (testIteration != 1)) continue;
await runTestIteration(testIteration);
}
return Promise.resolve();
}