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() {
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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();
}
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();