mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Update sample for microsoft/vscode-vsce#354
This commit is contained in:
@ -2,21 +2,22 @@ import * as path from 'path';
|
||||
|
||||
import { runTests } from 'vscode-test';
|
||||
|
||||
async function go() {
|
||||
async function main() {
|
||||
try {
|
||||
// The folder containing the Extension Manifest package.json
|
||||
// Passed to `--extensionDevelopmentPath`
|
||||
const extensionPath = path.resolve(__dirname, '../../');
|
||||
|
||||
// The path to test runner
|
||||
// Passed to --extensionTestsPath
|
||||
const testRunnerPath = path.resolve(__dirname, './suite');
|
||||
|
||||
await runTests({
|
||||
// The folder containing the Extension Manifest package.json
|
||||
extensionPath,
|
||||
// The path to test runner
|
||||
testRunnerPath
|
||||
});
|
||||
// Download VS Code, unzip it and run the integration test
|
||||
await runTests({ extensionPath, testRunnerPath });
|
||||
} catch (err) {
|
||||
console.error('Failed to run tests');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
go();
|
||||
main();
|
||||
|
||||
@ -19,10 +19,7 @@ export function run(testsRoot: string, cb: (error: any, failures?: number) => vo
|
||||
|
||||
try {
|
||||
// Run the mocha test
|
||||
mocha
|
||||
.run(failures => {
|
||||
cb(null, failures);
|
||||
});
|
||||
mocha.run(failures => cb(null, failures));
|
||||
|
||||
} catch (err) {
|
||||
cb(err);
|
||||
|
||||
Reference in New Issue
Block a user