How to use the vscode-test.runTests 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 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 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 kiegroup / kogito-tooling / packages / vscode-extension-pack-kogito-kie-editors / tests-it / main.ts View on Github external
async function main() {
  try {
    const extensionDevelopmentPath = __path.resolve(__dirname, "../../");
    const extensionTestsPath = __path.resolve(__dirname, "./suite");
    const workspace = __path.resolve(__dirname, "../../tests-it/test-workspace");

    await vscodeTest.runTests({
      extensionDevelopmentPath,
      extensionTestsPath,
      launchArgs: [workspace, "--disableExtensions"]
    });
  } catch (e) {
    console.error("Failed to run integration tests");
    process.exit(1);
  }
}
github valentjn / vscode-ltex / test / runTests.ts View on Github external
console.log(`Moving '${ltexOfflineLibDirPath}' to '${ltexLibDirPath}'...`);
      Fs.renameSync(ltexOfflineLibDirPath, ltexLibDirPath);
    }

    const testOptions: CodeTestRunTest.TestOptions = {
          vscodeExecutablePath: vscodeExecutablePath,
          launchArgs: [
            '--user-data-dir', userDataDirPath,
            '--extensions-dir', extensionsDirPath,
          ],
          extensionDevelopmentPath: ltexDirPath,
          extensionTestsPath: Path.join(__dirname, './index'),
        };

    console.log('Running tests...');
    const exitCode: number = await CodeTest.runTests(testOptions);

    if (exitCode != 0) throw new Error(`Test returned exit code ${exitCode}.`);
  } finally {
    if (tmpDirPath != null) Rimraf.sync(tmpDirPath);
  }

  return Promise.resolve();
}
github microsoft / vscode-languageserver-node / client-tests / src / runTests.ts View on Github external
async function go() {
	try {
		const extensionDevelopmentPath = path.resolve(__dirname, '..');
		const extensionTestsPath = __dirname;

		/**
		 * Basic usage
		 */
		await runTests({
			extensionDevelopmentPath,
			extensionTestsPath
		});
	} catch (err) {
		console.error('Failed to run tests');
		process.exitCode = 1;
	}
}
go();

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