File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed
Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { AppEventEmitter } from "./events";
33
44export interface App {
55 createEventEmitter < T > ( ) : AppEventEmitter < T > ;
6+ executeCommand ( command : string , ...args : any ) : Thenable < void > ;
67 mode : AppMode ;
78 subscriptions : Disposable [ ] ;
89 extensionPath : string ;
Original file line number Diff line number Diff line change @@ -39,4 +39,8 @@ export class ExtensionApp implements App {
3939 public createEventEmitter < T > ( ) : AppEventEmitter < T > {
4040 return new VSCodeAppEventEmitter < T > ( ) ;
4141 }
42+
43+ public executeCommand ( command : string , ...args : any ) : Thenable < void > {
44+ return vscode . commands . executeCommand ( command , args ) ;
45+ }
4246}
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ export function createMockApp({
77 workspaceStoragePath = "/mock/workspace/storage/path" ,
88 globalStoragePath = "/mock/global/storage/path" ,
99 createEventEmitter = < T > ( ) => new MockAppEventEmitter < T > ( ) ,
10+ executeCommand = jest . fn ( ( ) => Promise . resolve ( ) ) ,
1011} : {
1112 extensionPath ?: string ;
1213 workspaceStoragePath ?: string ;
1314 globalStoragePath ?: string ;
1415 createEventEmitter ?: < T > ( ) => AppEventEmitter < T > ;
16+ executeCommand ?: ( ) => Promise < void > ;
1517} ) : App {
1618 return {
1719 mode : AppMode . Test ,
@@ -20,6 +22,7 @@ export function createMockApp({
2022 workspaceStoragePath,
2123 globalStoragePath,
2224 createEventEmitter,
25+ executeCommand,
2326 } ;
2427}
2528
You can’t perform that action at this time.
0 commit comments