@@ -199,7 +199,13 @@ describe('org:create', () => {
199199 username : 'newScratchUsername' ,
200200 } ) ;
201201 const aliasStub = stubMethod ( sandbox , Aliases . prototype , 'set' ) ;
202- const configStub = stubMethod ( sandbox , Config . prototype , 'set' ) ;
202+ const setStub = sandbox . spy ( ) ;
203+ const writeStub = sandbox . spy ( ) ;
204+ const configCreateStub = stubMethod ( sandbox , Config , 'create' ) . withArgs ( { isGlobal : false } ) . resolves ( {
205+ set : setStub ,
206+ write : writeStub ,
207+ } ) ;
208+ // const configStub = stubMethod(sandbox, Config.prototype, 'set');
203209 await command . runIt ( ) ;
204210 expect ( prodOrg . firstCall . args [ 0 ] ) . to . deep . equal ( {
205211 apiversion : undefined ,
@@ -217,7 +223,10 @@ describe('org:create', () => {
217223 orgConfig : { } ,
218224 } ) ;
219225 expect ( aliasStub . firstCall . args ) . to . deep . equal ( [ 'sandboxAlias' , 'newScratchUsername' ] ) ;
220- expect ( configStub . firstCall . args ) . to . deep . equal ( [ 'defaultusername' , 'newScratchUsername' ] ) ;
226+ expect ( configCreateStub . calledOnce ) . to . be . true ;
227+ expect ( writeStub . calledOnce ) . to . be . true ;
228+ expect ( configCreateStub . firstCall . firstArg ) . to . deep . equal ( { isGlobal : false } ) ;
229+ expect ( setStub . firstCall . args ) . to . deep . equal ( [ 'defaultusername' , 'newScratchUsername' ] ) ;
221230 } ) ;
222231
223232 it ( 'will test json output' , async ( ) => {
0 commit comments