@@ -74,7 +74,7 @@ describe('ScalingConfig', () => {
7474 writable : true ,
7575 } ) ;
7676
77- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
77+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
7878 const provisionConfigErrorRetrySpy = jest
7979 . spyOn ( utils , 'provisionConfigErrorRetry' )
8080 . mockResolvedValue ( undefined ) ;
@@ -114,7 +114,7 @@ describe('ScalingConfig', () => {
114114
115115 isProvisionConfigErrorMock . mockReturnValue ( false ) ;
116116
117- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
117+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
118118 const provisionConfigErrorRetrySpy = jest
119119 . spyOn ( utils , 'provisionConfigErrorRetry' )
120120 . mockRejectedValue ( new Error ( 'network error' ) ) ;
@@ -160,7 +160,7 @@ describe('ScalingConfig', () => {
160160
161161 isProvisionConfigErrorMock . mockReturnValue ( true ) ;
162162
163- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
163+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
164164 const provisionConfigErrorRetrySpy = jest
165165 . spyOn ( utils , 'provisionConfigErrorRetry' )
166166 . mockImplementation ( async ( fcSdk , command , functionName , qualifier , localConfig ) => {
@@ -208,7 +208,7 @@ describe('ScalingConfig', () => {
208208
209209 isProvisionConfigErrorMock . mockReturnValue ( true ) ;
210210
211- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
211+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
212212 const provisionConfigErrorRetrySpy = jest
213213 . spyOn ( utils , 'provisionConfigErrorRetry' )
214214 . mockRejectedValue ( new Error ( 'Failed to create scalingConfig after 60 attempts' ) ) ;
@@ -249,7 +249,7 @@ describe('ScalingConfig', () => {
249249 writable : true ,
250250 } ) ;
251251
252- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
252+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
253253 const provisionConfigErrorRetrySpy = jest
254254 . spyOn ( utils , 'provisionConfigErrorRetry' )
255255 . mockResolvedValue ( undefined ) ;
@@ -376,7 +376,7 @@ describe('ScalingConfig', () => {
376376 putFunctionScalingConfig : jest . fn ( ) . mockResolvedValue ( undefined ) ,
377377 getFunctionScalingConfig : jest
378378 . fn ( )
379- . mockResolvedValue ( { currentInstances : 1 , minInstances : 1 } ) ,
379+ . mockResolvedValue ( { currentInstances : 1 , targetInstances : 1 } ) ,
380380 disableFunctionInvocation : jest . fn ( ) . mockResolvedValue ( undefined ) ,
381381 enableFunctionInvocation : jest . fn ( ) . mockResolvedValue ( undefined ) ,
382382 } ;
@@ -386,7 +386,7 @@ describe('ScalingConfig', () => {
386386 } ) ;
387387
388388 // Mock provisionConfigErrorRetry
389- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
389+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
390390 const provisionConfigErrorRetrySpy = jest
391391 . spyOn ( utils , 'provisionConfigErrorRetry' )
392392 . mockResolvedValue ( undefined ) ;
@@ -401,7 +401,7 @@ describe('ScalingConfig', () => {
401401 { minInstances : 1 } ,
402402 ) ;
403403 expect ( logger . info ) . toHaveBeenCalledWith (
404- 'ScalingConfig of test-function/LATEST is ready. CurrentInstances: 1, MinInstances : 1' ,
404+ 'ScalingConfig of test-function/LATEST is ready. CurrentInstances: 1, TargetInstances : 1' ,
405405 ) ;
406406 expect ( result ) . toBe ( true ) ;
407407 } ) ;
@@ -430,7 +430,7 @@ describe('ScalingConfig', () => {
430430 } ) ;
431431
432432 // Mock provisionConfigErrorRetry
433- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
433+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
434434 const provisionConfigErrorRetrySpy = jest
435435 . spyOn ( utils , 'provisionConfigErrorRetry' )
436436 . mockResolvedValue ( undefined ) ;
@@ -475,7 +475,7 @@ describe('ScalingConfig', () => {
475475 } ) ;
476476
477477 // Mock provisionConfigErrorRetry
478- const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
478+ const utils = require ( '../../../../../src/subCommands/deploy/utils/index ' ) ;
479479 const provisionConfigErrorRetrySpy = jest
480480 . spyOn ( utils , 'provisionConfigErrorRetry' )
481481 . mockResolvedValue ( undefined ) ;
@@ -644,15 +644,15 @@ describe('ScalingConfig', () => {
644644 expect ( mockFcSdk . getFunctionScalingConfig ) . toHaveBeenCalled ( ) ;
645645 } ) ;
646646
647- it ( 'should wait until currentInstances reaches minInstances ' , async ( ) => {
647+ it ( 'should wait until currentInstances reaches targetInstances ' , async ( ) => {
648648 scalingConfig = new ScalingConfig ( mockInputs , mockOpts ) ;
649649
650650 // Mock fcSdk
651651 const mockFcSdk = {
652652 getFunctionScalingConfig : jest
653653 . fn ( )
654- . mockResolvedValueOnce ( { currentInstances : 5 , minInstances : 10 } )
655- . mockResolvedValueOnce ( { currentInstances : 10 , minInstances : 10 } ) ,
654+ . mockResolvedValueOnce ( { currentInstances : 5 , targetInstances : 10 } )
655+ . mockResolvedValueOnce ( { currentInstances : 10 , targetInstances : 10 } ) ,
656656 disableFunctionInvocation : jest . fn ( ) . mockResolvedValue ( undefined ) ,
657657 enableFunctionInvocation : jest . fn ( ) . mockResolvedValue ( undefined ) ,
658658 } ;
@@ -665,7 +665,7 @@ describe('ScalingConfig', () => {
665665
666666 expect ( mockFcSdk . getFunctionScalingConfig ) . toHaveBeenCalledTimes ( 2 ) ;
667667 expect ( logger . info ) . toHaveBeenCalledWith (
668- 'ScalingConfig of test-function/LATEST is ready. CurrentInstances: 10, MinInstances : 10' ,
668+ 'ScalingConfig of test-function/LATEST is ready. CurrentInstances: 10, TargetInstances : 10' ,
669669 ) ;
670670 } ) ;
671671
0 commit comments