@@ -67,15 +67,14 @@ suite('openshift connector Extension', async () => {
6767 assert . ok ( vscode . extensions . getExtension ( 'redhat.vscode-openshift-connector' ) ) ;
6868 } ) ;
6969
70- async function getStaticMethodsToStub ( osc : string [ ] ) : Promise < string [ ] > {
70+ function getStaticMethodsToStub ( osc : string [ ] ) : string [ ] {
7171 const mths : Set < string > = new Set ( ) ;
7272 osc . forEach ( ( name ) => {
7373 name = name . replace ( '.palette' , '' ) ;
7474 const segs : string [ ] = name . split ( '.' ) ;
7575 let methName : string = segs [ segs . length - 1 ] ;
7676 methName = methName === 'delete' ? 'del' : methName ;
7777 ! mths . has ( methName ) && mths . add ( methName ) ;
78-
7978 } ) ;
8079 return [ ...mths ] ;
8180 }
@@ -84,15 +83,17 @@ suite('openshift connector Extension', async () => {
8483 sandbox . stub ( vscode . window , 'showErrorMessage' ) ;
8584 const cmds : string [ ] = await vscode . commands . getCommands ( ) ;
8685 const osc : string [ ] = cmds . filter ( ( item ) => item . startsWith ( 'openshift.' ) ) ;
87- const mths : string [ ] = await getStaticMethodsToStub ( osc ) ;
86+ const mths : string [ ] = getStaticMethodsToStub ( osc ) ;
8887 [ Application , Catalog , Cluster , Component , Project , Service , Storage , Url , OpenShiftExplorer ] . forEach ( ( item : { [ x : string ] : any ; } ) => {
8988 mths . forEach ( ( name ) => {
9089 if ( item [ name ] ) {
9190 sandbox . stub ( item , name ) . resolves ( ) ;
9291 }
9392 } ) ;
9493 } ) ;
95- osc . forEach ( ( item ) => vscode . commands . executeCommand ( item ) ) ;
94+ for ( const command of osc ) {
95+ await vscode . commands . executeCommand ( command ) ;
96+ }
9697 expect ( vscode . window . showErrorMessage ) . has . not . been . called ;
9798 } ) ;
9899
0 commit comments