@@ -168,11 +168,14 @@ describe('Provision', () => {
168168 ) ;
169169 } ) ;
170170
171- it ( 'should throw error when qualifier is not specified' , async ( ) => {
171+ it ( 'should use default qualifier when qualifier is not specified' , async ( ) => {
172172 mockInputs . args = [ 'get' ] ;
173173 provision = new Provision ( mockInputs ) ;
174- await expect ( provision . get ( ) ) . rejects . toThrow (
175- 'Qualifier not specified, please specify --qualifier' ,
174+ // The current implementation uses 'LATEST' as default when qualifier is not specified
175+ await expect ( provision . get ( ) ) . resolves . toEqual ( { target : 10 } ) ;
176+ expect ( mockFcInstance . getFunctionProvisionConfig ) . toHaveBeenCalledWith (
177+ 'test-function' ,
178+ 'LATEST' , // Default qualifier
176179 ) ;
177180 } ) ;
178181 } ) ;
@@ -195,11 +198,17 @@ describe('Provision', () => {
195198 ) ;
196199 } ) ;
197200
198- it ( 'should throw error when qualifier is not specified' , async ( ) => {
201+ it ( 'should use default qualifier when qualifier is not specified' , async ( ) => {
199202 mockInputs . args = [ 'put' , '--target' , '10' ] ;
200203 provision = new Provision ( mockInputs ) ;
201- await expect ( provision . put ( ) ) . rejects . toThrow (
202- 'Qualifier not specified, please specify --qualifier' ,
204+ // The current implementation uses 'LATEST' as default when qualifier is not specified
205+ await expect ( provision . put ( ) ) . resolves . toEqual ( { success : true } ) ;
206+ expect ( mockFcInstance . putFunctionProvisionConfig ) . toHaveBeenCalledWith (
207+ 'test-function' ,
208+ 'LATEST' , // Default qualifier
209+ expect . objectContaining ( {
210+ target : 10 ,
211+ } ) ,
203212 ) ;
204213 } ) ;
205214
@@ -304,11 +313,14 @@ describe('Provision', () => {
304313 ) ;
305314 } ) ;
306315
307- it ( 'should throw error when qualifier is not specified' , async ( ) => {
316+ it ( 'should use default qualifier when qualifier is not specified' , async ( ) => {
308317 mockInputs . args = [ 'remove' , '--assume-yes' ] ;
309318 provision = new Provision ( mockInputs ) ;
310- await expect ( provision . remove ( ) ) . rejects . toThrow (
311- 'Qualifier not specified, please specify --qualifier' ,
319+ // The current implementation uses 'LATEST' as default when qualifier is not specified
320+ await expect ( provision . remove ( ) ) . resolves . toBeUndefined ( ) ;
321+ expect ( mockFcInstance . removeFunctionProvisionConfig ) . toHaveBeenCalledWith (
322+ 'test-function' ,
323+ 'LATEST' , // Default qualifier
312324 ) ;
313325 } ) ;
314326
0 commit comments