How to use vscode-test - 10 common examples

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 redhat-developer / vscode-rsp-ui / test / unit-tests.ts View on Github external
async function main() {
    try {
        // The folder containing the Extension Manifest package.json
        // Passed to `--extensionDevelopmentPath`
        const extensionDevelopmentPath = path.resolve(__dirname, '../..');

        // The path to the extension test runner script
        // Passed to --extensionTestsPath
        const extensionTestsPath = path.resolve(__dirname, './');

        // Download VS Code, unzip it and run the integration test
        console.log(extensionDevelopmentPath, extensionTestsPath);
        await runTests({ extensionDevelopmentPath, extensionTestsPath });
    } catch (err) {
        console.error(err);
        process.exit(1);
    }
}
github microsoft / vscode-java-test / test / index.ts View on Github external
encoding: 'utf-8',
            stdio: 'inherit',
        });

        // Run Maven JUnit 4 Code Lens tests
        await runTests({
            vscodeExecutablePath,
            extensionDevelopmentPath,
            extensionTestsPath: path.resolve(__dirname, './maven-junit4-suite'),
            launchArgs: [
                path.join(__dirname, '..', '..', 'test', 'test-projects', 'junit4'),
            ],
        });

        // Run Gradle modular project tests
        await runTests({
            vscodeExecutablePath,
            extensionDevelopmentPath,
            extensionTestsPath: path.resolve(__dirname, './gradle-modular-suite'),
            launchArgs: [
                path.join(__dirname, '..', '..', 'test', 'test-projects', 'modular-gradle'),
            ],
        });

    } catch (err) {
        console.error('Failed to run tests');
        process.exit(1);
    }
}
github redhat-developer / vscode-openshift-tools / build / unit-tests.ts View on Github external
async function main() {
  try {
    // The folder containing the Extension Manifest package.json
    // Passed to `--extensionDevelopmentPath`
    const extensionDevelopmentPath = path.resolve(__dirname, '../../');

    // The path to the extension test runner script
    // Passed to --extensionTestsPath
    const extensionTestsPath = path.resolve(__dirname, '../../out/test/unit/');

    // Download VS Code, unzip it and run the integration test
    console.log(extensionDevelopmentPath, extensionTestsPath);
    await runTests({ extensionDevelopmentPath, extensionTestsPath });
  } catch (err) {
    console.error(err);
    process.exit(1);
  }
}
github redhat-developer / vscode-tekton / build / unit-tests.ts View on Github external
async function main() {
  try {
    // The folder containing the Extension Manifest package.json
    // Passed to `--extensionDevelopmentPath`
    const extensionDevelopmentPath = path.resolve(__dirname, '../../');

    // The path to the extension test runner script
    // Passed to --extensionTestsPath
    const extensionTestsPath = path.resolve(__dirname, '../../out/test/');

    // Download VS Code, unzip it and run the integration test
    console.log(extensionDevelopmentPath, extensionTestsPath);
    await runTests({ extensionDevelopmentPath, extensionTestsPath });
  } catch (err) {
    console.error(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 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,
            extensionTestsPath: path.resolve(__dirname, './maven-junit4-suite'),
github IBM-Blockchain / blockchain-vscode-extension / packages / blockchain-extension / cucumber / runCucumberTests.ts View on Github external
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
        console.error('Failed to run tests', err);
        process.exit(1);
    }
}
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 IBM-Blockchain / blockchain-vscode-extension / packages / blockchain-extension / cucumber / runCucumberTests.ts View on Github external
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

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

50 / 100
Full package analysis

Similar packages