@@ -189,6 +189,45 @@ describe('BaseClass', () => {
189189 expect ( printAllVariablesMock ) . toHaveBeenCalled ( ) ;
190190 expect ( baseClass . envVariables ) . toEqual ( expectedEnv ) ;
191191 } ) ;
192+
193+ it ( 'should handle variableType passed as string from command line flag' , async ( ) => {
194+ baseClass = new BaseClass ( {
195+ log : logMock ,
196+ exit : exitMock ,
197+ config : {
198+ variableType : 'Skip adding environment variables' ,
199+ variablePreparationTypeOptions : config . variablePreparationTypeOptions ,
200+ } ,
201+ } as any ) ;
202+
203+ await baseClass . handleEnvImportFlow ( ) ;
204+
205+ expect ( baseClass . envVariables ) . toEqual ( [ ] ) ;
206+ expect ( logMock ) . toHaveBeenCalledWith ( 'Skipped adding environment variables.' , 'info' ) ;
207+ expect ( exitMock ) . not . toHaveBeenCalled ( ) ;
208+ } ) ;
209+
210+ it ( 'should handle variableType string and not trigger "cannot be combined" error' , async ( ) => {
211+ baseClass = new BaseClass ( {
212+ log : logMock ,
213+ exit : exitMock ,
214+ config : {
215+ variableType : 'Import variables from a stack' ,
216+ variablePreparationTypeOptions : config . variablePreparationTypeOptions ,
217+ } ,
218+ } as any ) ;
219+
220+ const importEnvFromStackMock = jest . spyOn ( baseClass , 'importEnvFromStack' ) . mockResolvedValueOnce ( ) ;
221+
222+ await baseClass . handleEnvImportFlow ( ) ;
223+
224+ expect ( importEnvFromStackMock ) . toHaveBeenCalled ( ) ;
225+ expect ( exitMock ) . not . toHaveBeenCalled ( ) ;
226+ expect ( logMock ) . not . toHaveBeenCalledWith (
227+ expect . stringContaining ( "cannot be combined" ) ,
228+ 'error' ,
229+ ) ;
230+ } ) ;
192231 } ) ;
193232
194233 describe ( 'importVariableFromLocalConfig' , ( ) => {
0 commit comments