How to use the vscode-test.downloadAndUnzipVSCode function in vscode-test

To help you get started, we’ve selected a few vscode-test examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM-Blockchain / blockchain-vscode-extension / test / runTests.ts View on Github external
async function main(): Promise {
    try {
        let version: string = 'stable';
        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);

        console.log('downloading vscode');
        await downloadAndUnzipVSCode(version);

        // Download VS Code, unzip it and run the integration test
        console.log('setting up tests');

        await runTests({extensionDevelopmentPath, extensionTestsPath, version: version});

    } catch (err) {
        console.error('Failed to run tests', err);
        process.exit(1);
    }
}
github microsoft / vscode-java-test / test / index.ts View on Github external
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,
github IBM-Blockchain / blockchain-vscode-extension / packages / blockchain-extension / cucumber / runCucumberTests.ts View on Github external
try {
        let version: string = 'stable';
        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
        });
github valentjn / vscode-ltex / test / runTests.ts View on Github external
for (const arg of process.argv) {
    if (arg == '--fast') fastMode = true;
  }

  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();
}
github forcedotcom / salesforcedx-vscode / scripts / download-vscode-install-dependencies-system-tests.js View on Github external
async function go() {
  const vscodeExecutablePath = await vscodetest.downloadAndUnzipVSCode();

  console.log('vscodeExecutablePath ====>', vscodeExecutablePath);

  const executablePath = getExecutable(vscodeExecutablePath);
  console.log('executablePath ====>', executablePath);

  shell.exec(`'${executablePath}' --install-extension dbaeumer.vscode-eslint`);

  process.env.VSCODE_BINARY_PATH = executablePath;

  console.log(
    'process.env.VSCODE_BINARY_PATH => ',
    process.env.VSCODE_BINARY_PATH
  );

  const testRunnerPath = path.join(
github streetsidesoftware / vscode-spell-checker / packages / _integrationTests / integrationTestRunner / index.js View on Github external
function downloadExecutableAndRunTests() {
    downloadAndUnzipVSCode(process.env.CODE_VERSION).then(executablePath => {
        runTests(executablePath)
    }).catch(err => {
        console.error('Failed to run test with error:')
        console.log(err);
        process.exit(1);
    })
}
github microsoft / vscode-mssql / gulpfile.js View on Github external
gulp.task('ext:test', async function () {
    let workspace = process.env['WORKSPACE'];
    if (!workspace) {
        workspace = process.cwd();
    }
    process.env.JUNIT_REPORT_PATH = workspace + '/test-reports/ext_xunit.xml';
    var args = ['--verbose', '--disable-gpu', '--disable-telemetry', '--disable-updates', '-n'];
    let vscodeVersion = packageJson.engines.vscode.slice(1);
    let vscodePath = await vscodeTest.downloadAndUnzipVSCode(vscodeVersion);
    let extensionTestsPath = `${workspace}/out/test`;
    try {
        await vscodeTest.runTests({
            vscodeExecutablePath: vscodePath,
            extensionDevelopmentPath: workspace,
            extensionTestsPath: extensionTestsPath,
            launchArgs: args
        });
    } catch (error) {
        console.log(`stdout: ${process.stdout}`);
        console.log(`stderr: ${process.stderr}`);
        console.error(`exec error: ${error}`);
        throw(error);
    }
});
github redhat-developer / vscode-tekton / build / install-vscode.ts View on Github external
import cp = require('child_process');
import path = require('path');
import { platform } from 'os';
const downloadAndUnzipVSCode = require('vscode-test').downloadAndUnzipVSCode;
downloadAndUnzipVSCode().then((executable: string) => {
    if (platform() === 'darwin') {
        executable = `'${path.join(executable.substring(0, executable.indexOf('.app')+4), 'Contents', 'Resources', 'app', 'bin', 'code')}'`;
    } else {
        executable = path.join(path.dirname(executable), 'bin', 'code');
    }
    cp.execSync(`${executable} --install-extension ms-kubernetes-tools.vscode-kubernetes-tools`);
});

vscode-test

![Test Status Badge](https://github.com/microsoft/vscode-test/workflows/Tests/badge.svg)

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages