@@ -98,18 +98,22 @@ describe('SlackCLIProcess class', () => {
9898 await cmd . execAsync ( ) ;
9999 sandbox . assert . calledWith ( spawnProcessSpy , sinon . match . string , sinon . match . array . contains ( [ '--skip-update' ] ) ) ;
100100 } ) ;
101- it ( 'should default to `--app deployed` but allow overriding that via the `app` parameter' , async ( ) => {
101+ it ( 'should only pass `--app` when explicitly provided via the `app` parameter' , async ( ) => {
102102 let cmd = new SlackCLIProcess ( [ 'help' ] ) ;
103103 await cmd . execAsync ( ) ;
104+ sandbox . assert . neverCalledWith ( spawnProcessSpy , sinon . match . string , sinon . match . array . contains ( [ '--app' ] ) ) ;
105+ spawnProcessSpy . resetHistory ( ) ;
106+ cmd = new SlackCLIProcess ( [ 'help' ] , { app : 'local' } ) ;
107+ await cmd . execAsync ( ) ;
108+ sandbox . assert . calledWith ( spawnProcessSpy , sinon . match . string , sinon . match . array . contains ( [ '--app' , 'local' ] ) ) ;
109+ spawnProcessSpy . resetHistory ( ) ;
110+ cmd = new SlackCLIProcess ( [ 'help' ] , { app : 'deployed' } ) ;
111+ await cmd . execAsync ( ) ;
104112 sandbox . assert . calledWith (
105113 spawnProcessSpy ,
106114 sinon . match . string ,
107115 sinon . match . array . contains ( [ '--app' , 'deployed' ] ) ,
108116 ) ;
109- spawnProcessSpy . resetHistory ( ) ;
110- cmd = new SlackCLIProcess ( [ 'help' ] , { app : 'local' } ) ;
111- await cmd . execAsync ( ) ;
112- sandbox . assert . calledWith ( spawnProcessSpy , sinon . match . string , sinon . match . array . contains ( [ '--app' , 'local' ] ) ) ;
113117 } ) ;
114118 it ( 'should default to `--force` but allow overriding that via the `force` parameter' , async ( ) => {
115119 let cmd = new SlackCLIProcess ( [ 'help' ] ) ;
0 commit comments