File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ describe('myDomainResolver', () => {
20
20
const TEST_IP = '1.1.1.1' ;
21
21
const CALL_COUNT = 3 ;
22
22
23
- let lookupAsyncSpy : { callCount : number } ;
23
+ let lookupAsyncSpy : sinon . SinonStub ;
24
+
24
25
beforeEach ( ( ) => {
25
26
lookupAsyncSpy = $$ . SANDBOX . stub ( dns , 'lookup' ) . callsFake ( ( host : string , callback : AnyFunction ) => {
26
27
const isDefaultHost = host === MyDomainResolver . DEFAULT_DOMAIN . host ;
@@ -45,6 +46,17 @@ describe('myDomainResolver', () => {
45
46
expect ( lookupAsyncSpy . callCount ) . to . be . equal ( CALL_COUNT ) ;
46
47
} ) ;
47
48
49
+ it ( 'should do lookup without port' , async ( ) => {
50
+ const options : MyDomainResolver . Options = {
51
+ url : new URL ( `https://${ POSITIVE_HOST } :6101` ) ,
52
+ } ;
53
+ const resolver : MyDomainResolver = await MyDomainResolver . create ( options ) ;
54
+ const ip = await resolver . resolve ( ) ;
55
+ expect ( ip ) . to . be . equal ( TEST_IP ) ;
56
+ // verify that it uses hostname (without port) not host
57
+ expect ( lookupAsyncSpy . args [ 0 ] [ 0 ] ) . to . be . equal ( POSITIVE_HOST ) ;
58
+ } ) ;
59
+
48
60
describe ( 'disable dns check' , ( ) => {
49
61
const env = new Env ( ) ;
50
62
it ( 'should return host if SFDX_DISABLE_DNS_CHECK is set to true' , async ( ) => {
You can’t perform that action at this time.
0 commit comments