blob: beea43738c9e8de534032146c84433740bb430e5 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as path from 'path';
import { runTests } from 'vscode-test';
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
// The path to the workspace file
const workspace = path.resolve('test-fixtures');
// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
/**
* The `--disable-extensions` option is for disabling other extensions while debugging.
* https://code.visualstudio.com/api/working-with-extensions/testing-extension#disabling-other-extensions-while-debugging
*/
launchArgs: [workspace, '--disable-extensions'],
extensionTestsEnv: { VSCODE_TEST_MODE: 'true' },
});
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
main();