@@ -137,20 +137,27 @@ describe('ProvisionConfig', () => {
137137 writable : true ,
138138 } ) ;
139139
140- // Mock scalingConfig.provisionConfigErrorRetry
140+ // Mock provisionConfigErrorRetry
141+ const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
141142 const provisionConfigErrorRetrySpy = jest
142- . spyOn ( provisionConfig . scalingConfig , 'provisionConfigErrorRetry' )
143+ . spyOn ( utils , 'provisionConfigErrorRetry' )
143144 . mockResolvedValue ( undefined ) ;
144145
145146 const result = await provisionConfig . run ( ) ;
146147
147- expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith ( 'ProvisionConfig' , 'LATEST' , {
148- defaultTarget : 10 ,
149- alwaysAllocateCPU : false ,
150- alwaysAllocateGPU : false ,
151- scheduledActions : [ ] ,
152- targetTrackingPolicies : [ ] ,
153- } ) ;
148+ expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith (
149+ provisionConfig . fcSdk ,
150+ 'ProvisionConfig' ,
151+ 'test-function' ,
152+ 'LATEST' ,
153+ {
154+ defaultTarget : 10 ,
155+ alwaysAllocateCPU : false ,
156+ alwaysAllocateGPU : false ,
157+ scheduledActions : [ ] ,
158+ targetTrackingPolicies : [ ] ,
159+ } ,
160+ ) ;
154161 expect ( result ) . toBe ( true ) ;
155162 } ) ;
156163
@@ -171,9 +178,10 @@ describe('ProvisionConfig', () => {
171178 writable : true ,
172179 } ) ;
173180
174- // Mock scalingConfig.provisionConfigErrorRetry
181+ // Mock provisionConfigErrorRetry
182+ const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
175183 const provisionConfigErrorRetrySpy = jest
176- . spyOn ( provisionConfig . scalingConfig , 'provisionConfigErrorRetry' )
184+ . spyOn ( utils , 'provisionConfigErrorRetry' )
177185 . mockResolvedValue ( undefined ) ;
178186
179187 const waitForProvisionReadySpy = jest
@@ -182,13 +190,19 @@ describe('ProvisionConfig', () => {
182190
183191 await provisionConfig . run ( ) ;
184192
185- expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith ( 'ProvisionConfig' , 'LATEST' , {
186- defaultTarget : 10 ,
187- alwaysAllocateCPU : false ,
188- alwaysAllocateGPU : false ,
189- scheduledActions : [ ] ,
190- targetTrackingPolicies : [ ] ,
191- } ) ;
193+ expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith (
194+ provisionConfig . fcSdk ,
195+ 'ProvisionConfig' ,
196+ 'test-function' ,
197+ 'LATEST' ,
198+ {
199+ defaultTarget : 10 ,
200+ alwaysAllocateCPU : false ,
201+ alwaysAllocateGPU : false ,
202+ scheduledActions : [ ] ,
203+ targetTrackingPolicies : [ ] ,
204+ } ,
205+ ) ;
192206 expect ( waitForProvisionReadySpy ) . toHaveBeenCalledWith ( 'LATEST' , {
193207 defaultTarget : 10 ,
194208 alwaysAllocateCPU : false ,
@@ -215,22 +229,29 @@ describe('ProvisionConfig', () => {
215229 writable : true ,
216230 } ) ;
217231
218- // Mock scalingConfig.provisionConfigErrorRetry
232+ // Mock provisionConfigErrorRetry
233+ const utils = require ( '../../../../../src/subCommands/deploy/utils' ) ;
219234 const provisionConfigErrorRetrySpy = jest
220- . spyOn ( provisionConfig . scalingConfig , 'provisionConfigErrorRetry' )
235+ . spyOn ( utils , 'provisionConfigErrorRetry' )
221236 . mockResolvedValue ( undefined ) ;
222237
223238 const waitForProvisionReadySpy = jest . spyOn ( provisionConfig as any , 'waitForProvisionReady' ) ;
224239
225240 await provisionConfig . run ( ) ;
226241
227- expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith ( 'ProvisionConfig' , 'LATEST' , {
228- defaultTarget : 10 ,
229- alwaysAllocateCPU : false ,
230- alwaysAllocateGPU : false ,
231- scheduledActions : [ ] ,
232- targetTrackingPolicies : [ ] ,
233- } ) ;
242+ expect ( provisionConfigErrorRetrySpy ) . toHaveBeenCalledWith (
243+ provisionConfig . fcSdk ,
244+ 'ProvisionConfig' ,
245+ 'test-function' ,
246+ 'LATEST' ,
247+ {
248+ defaultTarget : 10 ,
249+ alwaysAllocateCPU : false ,
250+ alwaysAllocateGPU : false ,
251+ scheduledActions : [ ] ,
252+ targetTrackingPolicies : [ ] ,
253+ } ,
254+ ) ;
234255 expect ( waitForProvisionReadySpy ) . not . toHaveBeenCalled ( ) ;
235256 expect ( logger . info ) . toHaveBeenCalledWith (
236257 `Skip wait provisionConfig of ${ provisionConfig . functionName } /LATEST to instance up` ,
0 commit comments