From 13ce554579de973ca103bf870d6032652b7d2a3f Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 21 Jun 2019 15:48:01 +0800 Subject: [PATCH] Drop ExplicitTestOption --- lib/runTest.ts | 37 +++++++------------------------------ sample/test/runTest.ts | 11 ----------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/lib/runTest.ts b/lib/runTest.ts index c4580a6..49cc8bf 100644 --- a/lib/runTest.ts +++ b/lib/runTest.ts @@ -71,41 +71,18 @@ export interface TestOptions extends BaseTestOptions { additionalLaunchArgs?: string[]; } -export interface ExplicitTestOptions extends BaseTestOptions { - /** - * A list of arguments used for launching VS Code executable. - * - * You need to provide `--extensionDevelopmentPath` and `--extensionTestsPath` manually when - * using this option. If you want to open a specific file, folder or workspace when launching - * VS Code, you need to pass its absolute path as first item in this list. - * - * You can also use this interface for setting up the extension testing environment, such as - * using `--data-dir` to setup a user data directory, or using `--install-extension` to install - * other extensions needed for testing. - * - * See `code --help` for possible arguments. - */ - launchArgs: string[]; -} - -export async function runTests(options: TestOptions | ExplicitTestOptions): Promise { +export async function runTests(options: TestOptions): Promise { if (!options.vscodeExecutablePath) { options.vscodeExecutablePath = await downloadAndUnzipVSCode(options.version); } - let args = []; - if ('launchArgs' in options) { - args = options.launchArgs; - } else { - args = [ - '--extensionDevelopmentPath=' + options.extensionPath, - '--extensionTestsPath=' + options.testRunnerPath - ]; - - if (options.additionalLaunchArgs) { - args = options.additionalLaunchArgs.concat(args) - } + let args = [ + '--extensionDevelopmentPath=' + options.extensionPath, + '--extensionTestsPath=' + options.testRunnerPath + ]; + if (options.additionalLaunchArgs) { + args = options.additionalLaunchArgs.concat(args) } return innerRunTests(options.vscodeExecutablePath, args, options.testRunnerEnv); diff --git a/sample/test/runTest.ts b/sample/test/runTest.ts index cee0168..b2ac5b3 100644 --- a/sample/test/runTest.ts +++ b/sample/test/runTest.ts @@ -81,17 +81,6 @@ async function go() { testRunnerEnv: { foo: 'bar' } }) - /** - * Manually specify all launch flags for VS Code - */ - await runTests({ - vscodeExecutablePath, - launchArgs: [ - testWorkspace, - `--extensionDevelopmentPath=${extensionPath}`, - `--extensionTestsPath=${testRunnerPath}` - ] - }) } catch (err) { console.error('Failed to run tests') process.exit(1)