File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ import * as dotenv from 'dotenv';
77dotenv . config ( { override : true } ) ;
88// console.log(process.env);
99
10+ /**
11+ * Set this env variable to tell the VS Code extension we are running in a
12+ * testing environment
13+ */
14+ process . env [ 'ALS_VSCODE_TEST_ENV' ] = '1' ;
15+
1016let baseMochaOptions = {
1117 ui : 'tdd' ,
1218 color : true ,
Original file line number Diff line number Diff line change @@ -712,3 +712,9 @@ export function getMatchingPrefixes(
712712
713713 return [ prefix1 , prefix2 ] ;
714714}
715+
716+ /**
717+ * This constant indicates whether the code is running in a testing
718+ * environment.
719+ */
720+ export const inTesting = process . env [ 'ALS_VSCODE_TEST_ENV' ] === '1' ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121 QuickPickItem ,
2222 window ,
2323} from 'vscode' ;
24+ import { inTesting } from './helpers' ;
2425
2526// -------------------------------------------------------
2627// Helper code that wraps the API for the multi-step case.
@@ -183,6 +184,19 @@ export class MultiStepInput {
183184 }
184185 this . current = input ;
185186 this . current . show ( ) ;
187+
188+ if ( inTesting ) {
189+ /**
190+ * In testing, do not wait for User selection and return
191+ * the default selections immediately.
192+ */
193+ this . current . hide ( ) ;
194+ if ( canSelectMany ) {
195+ resolve ( < any > input . selectedItems . concat ( ) ) ;
196+ } else {
197+ resolve ( < any > input . selectedItems [ 0 ] ) ;
198+ }
199+ }
186200 } ) ;
187201 } finally {
188202 disposables . forEach ( ( d ) => d . dispose ( ) ) ;
You can’t perform that action at this time.
0 commit comments