44 * Licensed under the BSD 3-Clause license.
55 * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66 */
7- import { Config , GlobalInfo , SfError , Messages , Org , SfProject } from '@salesforce/core' ;
7+ import { Config , StateAggregator , SfError , Messages , Org , SfProject } from '@salesforce/core' ;
88import { fromStub , stubInterface , stubMethod } from '@salesforce/ts-sinon' ;
99import * as sinon from 'sinon' ;
1010import { expect } from '@salesforce/command/lib/test' ;
@@ -46,7 +46,6 @@ describe('org:create', () => {
4646 let promptStub : sinon . SinonStub ;
4747 let aliasGetStub : sinon . SinonStub ;
4848 let aliasSetStub : sinon . SinonSpy ;
49- let aliasUpdateStub : sinon . SinonSpy ;
5049 let cmd : TestCreate ;
5150
5251 class TestCreate extends Create {
@@ -204,12 +203,10 @@ describe('org:create', () => {
204203 } ) ;
205204 aliasGetStub = sinon . stub ( ) . returns ( '' ) ;
206205 aliasSetStub = sinon . spy ( ) ;
207- aliasUpdateStub = sinon . spy ( ) ;
208- stubMethod ( sandbox , GlobalInfo , 'getInstance' ) . returns ( {
206+ stubMethod ( sandbox , StateAggregator , 'getInstance' ) . returns ( {
209207 aliases : {
210208 get : aliasGetStub ,
211209 set : aliasSetStub ,
212- update : aliasUpdateStub ,
213210 } ,
214211 } ) ;
215212 const configStub = stubMethod ( sandbox , Config . prototype , 'set' ) ;
@@ -229,7 +226,7 @@ describe('org:create', () => {
229226 retry : 0 ,
230227 orgConfig : { } ,
231228 } ) ;
232- expect ( aliasUpdateStub . firstCall . args ) . to . deep . equal ( [ 'scratchOrgAlias' , 'newScratchUsername' ] ) ;
229+ expect ( aliasSetStub . firstCall . args ) . to . deep . equal ( [ 'scratchOrgAlias' , 'newScratchUsername' ] ) ;
233230 expect ( aliasGetStub . firstCall . args ) . to . deep . equal ( [ 'newScratchUsername' ] ) ;
234231 expect ( configStub . firstCall . args ) . to . deep . equal ( [ 'target-org' , 'newScratchUsername' ] ) ;
235232 } ) ;
@@ -256,11 +253,11 @@ describe('org:create', () => {
256253 } ) ;
257254
258255 aliasGetStub = sinon . stub ( ) . returns ( 'scratchOrgAlias' ) ;
259- aliasUpdateStub = sinon . spy ( ) ;
260- stubMethod ( sandbox , GlobalInfo , 'getInstance' ) . returns ( {
256+ aliasSetStub = sinon . spy ( ) ;
257+ stubMethod ( sandbox , StateAggregator , 'getInstance' ) . returns ( {
261258 aliases : {
262259 get : aliasGetStub ,
263- update : aliasUpdateStub ,
260+ set : aliasSetStub ,
264261 } ,
265262 } ) ;
266263
@@ -281,7 +278,7 @@ describe('org:create', () => {
281278 retry : 0 ,
282279 orgConfig : { } ,
283280 } ) ;
284- expect ( aliasUpdateStub . firstCall . args ) . to . deep . equal ( [ 'scratchOrgAlias' , 'newScratchUsername' ] ) ;
281+ expect ( aliasSetStub . firstCall . args ) . to . deep . equal ( [ 'scratchOrgAlias' , 'newScratchUsername' ] ) ;
285282 expect ( aliasGetStub . firstCall . args ) . to . deep . equal ( [ 'newScratchUsername' ] ) ;
286283 expect ( configStub . firstCall . args ) . to . deep . equal ( [ 'target-org' , 'scratchOrgAlias' ] ) ;
287284 } ) ;
0 commit comments