diff --git a/helloworld-test-sample/src/test/runTest.ts b/helloworld-test-sample/src/test/runTest.ts index 474e6323..475b0d36 100644 --- a/helloworld-test-sample/src/test/runTest.ts +++ b/helloworld-test-sample/src/test/runTest.ts @@ -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(); diff --git a/helloworld-test-sample/src/test/suite/index.ts b/helloworld-test-sample/src/test/suite/index.ts index 1bc29e91..10bb1fb8 100644 --- a/helloworld-test-sample/src/test/suite/index.ts +++ b/helloworld-test-sample/src/test/suite/index.ts @@ -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);