@@ -11,7 +11,7 @@ import { tmpdir as osTmpdir } from 'os';
11
11
import { join as pathJoin } from 'path' ;
12
12
import * as sinonType from 'sinon' ;
13
13
14
- import { once , set } from '@salesforce/kit' ;
14
+ import { once } from '@salesforce/kit' ;
15
15
import { stubMethod } from '@salesforce/ts-sinon' ;
16
16
import {
17
17
AnyFunction ,
@@ -20,7 +20,6 @@ import {
20
20
ensureAnyJson ,
21
21
ensureJsonMap ,
22
22
ensureString ,
23
- getBoolean ,
24
23
isJsonMap ,
25
24
JsonMap ,
26
25
Optional ,
@@ -721,7 +720,8 @@ export class StreamingMockCometClient extends CometClient {
721
720
*/
722
721
export class MockTestOrgData {
723
722
public testId : string ;
724
- public alias ?: string ;
723
+ public aliases ?: string [ ] ;
724
+ public configs ?: string [ ] ;
725
725
public username : string ;
726
726
public devHubUsername ?: string ;
727
727
public orgId : string ;
@@ -734,6 +734,9 @@ export class MockTestOrgData {
734
734
public refreshToken : string ;
735
735
public userId : string ;
736
736
public redirectUri : string ;
737
+ public isDevHub ?: boolean ;
738
+ public isScratchOrg ?: boolean ;
739
+ public isExpired ?: boolean | 'unknown' ;
737
740
738
741
public constructor ( id : string = uniqid ( ) , options ?: { username : string } ) {
739
742
this . testId = id ;
@@ -755,20 +758,24 @@ export class MockTestOrgData {
755
758
}
756
759
757
760
public makeDevHub ( ) : void {
758
- set ( this , ' isDevHub' , true ) ;
761
+ this . isDevHub = true ;
759
762
}
760
763
761
764
public createUser ( user : string ) : MockTestOrgData {
762
765
const userMock = new MockTestOrgData ( ) ;
763
766
userMock . username = user ;
764
- userMock . alias = this . alias ;
767
+ userMock . aliases = this . aliases ;
768
+ userMock . configs = this . configs ;
765
769
userMock . devHubUsername = this . devHubUsername ;
766
770
userMock . orgId = this . orgId ;
767
771
userMock . loginUrl = this . loginUrl ;
768
772
userMock . instanceUrl = this . instanceUrl ;
769
773
userMock . clientId = this . clientId ;
770
774
userMock . clientSecret = this . clientSecret ;
771
775
userMock . redirectUri = this . redirectUri ;
776
+ userMock . isDevHub = this . isDevHub ;
777
+ userMock . isScratchOrg = this . isScratchOrg ;
778
+ userMock . isExpired = this . isExpired ;
772
779
return userMock ;
773
780
}
774
781
@@ -777,7 +784,8 @@ export class MockTestOrgData {
777
784
Id : this . userId ,
778
785
Username : this . username ,
779
786
LastName : `user_lastname_${ this . testId } ` ,
780
- Alias : this . alias || 'user_alias_blah' ,
787
+ Alias : this . aliases ? this . aliases [ 0 ] : 'user_alias_blah' ,
788
+ Configs : this . configs ,
781
789
TimeZoneSidKey : `user_timezonesidkey_${ this . testId } ` ,
782
790
LocaleSidKey : `user_localesidkey_${ this . testId } ` ,
783
791
EmailEncodingKey : `user_emailencodingkey_${ this . testId } ` ,
@@ -808,16 +816,12 @@ export class MockTestOrgData {
808
816
config . createdOrgInstance = 'CS1' ;
809
817
config . created = '1519163543003' ;
810
818
config . userId = this . userId ;
811
- // config.devHubUsername = 'tn@su-blitz.org';
812
819
813
820
if ( this . devHubUsername ) {
814
821
config . devHubUsername = this . devHubUsername ;
815
822
}
816
823
817
- const isDevHub = getBoolean ( this , 'isDevHub' ) ;
818
- if ( isDevHub ) {
819
- config . isDevHub = isDevHub ;
820
- }
824
+ config . isDevHub = this . isDevHub ;
821
825
822
826
return config as SfOrg ;
823
827
}
0 commit comments