@@ -53,7 +53,9 @@ describe('http/getAxiosConfig', () => {
5353describe ( 'hostnameMatchesNoProxyPattern' , ( ) => {
5454 it ( 'matches exact hostname' , ( ) => {
5555 expect ( hostnameMatchesNoProxyPattern ( 'localhost' , 'localhost' ) ) . toBe ( true ) ;
56- expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'api.hubapi.com' ) ) . toBe ( true ) ;
56+ expect (
57+ hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'api.hubapi.com' )
58+ ) . toBe ( true ) ;
5759 } ) ;
5860
5961 it ( 'matches wildcard *' , ( ) => {
@@ -62,30 +64,54 @@ describe('hostnameMatchesNoProxyPattern', () => {
6264 } ) ;
6365
6466 it ( 'matches domain suffix with leading dot' , ( ) => {
65- expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , '.hubapi.com' ) ) . toBe ( true ) ;
66- expect ( hostnameMatchesNoProxyPattern ( 'foo.bar.hubapi.com' , '.hubapi.com' ) ) . toBe ( true ) ;
67- expect ( hostnameMatchesNoProxyPattern ( 'hubapi.com' , '.hubapi.com' ) ) . toBe ( false ) ;
67+ expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , '.hubapi.com' ) ) . toBe (
68+ true
69+ ) ;
70+ expect (
71+ hostnameMatchesNoProxyPattern ( 'foo.bar.hubapi.com' , '.hubapi.com' )
72+ ) . toBe ( true ) ;
73+ expect ( hostnameMatchesNoProxyPattern ( 'hubapi.com' , '.hubapi.com' ) ) . toBe (
74+ false
75+ ) ;
6876 } ) ;
6977
7078 it ( 'matches domain suffix without leading dot' , ( ) => {
71- expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'hubapi.com' ) ) . toBe ( true ) ;
72- expect ( hostnameMatchesNoProxyPattern ( 'hubapi.com' , 'hubapi.com' ) ) . toBe ( true ) ;
73- expect ( hostnameMatchesNoProxyPattern ( 'foo.bar.hubapi.com' , 'hubapi.com' ) ) . toBe ( true ) ;
79+ expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'hubapi.com' ) ) . toBe (
80+ true
81+ ) ;
82+ expect ( hostnameMatchesNoProxyPattern ( 'hubapi.com' , 'hubapi.com' ) ) . toBe (
83+ true
84+ ) ;
85+ expect (
86+ hostnameMatchesNoProxyPattern ( 'foo.bar.hubapi.com' , 'hubapi.com' )
87+ ) . toBe ( true ) ;
7488 } ) ;
7589
7690 it ( 'does not match partial hostnames' , ( ) => {
77- expect ( hostnameMatchesNoProxyPattern ( 'nothubapi.com' , 'hubapi.com' ) ) . toBe ( false ) ;
78- expect ( hostnameMatchesNoProxyPattern ( 'api.nothubapi.com' , 'hubapi.com' ) ) . toBe ( false ) ;
91+ expect ( hostnameMatchesNoProxyPattern ( 'nothubapi.com' , 'hubapi.com' ) ) . toBe (
92+ false
93+ ) ;
94+ expect (
95+ hostnameMatchesNoProxyPattern ( 'api.nothubapi.com' , 'hubapi.com' )
96+ ) . toBe ( false ) ;
7997 } ) ;
8098
8199 it ( 'is case insensitive' , ( ) => {
82- expect ( hostnameMatchesNoProxyPattern ( 'API.HUBAPI.COM' , 'hubapi.com' ) ) . toBe ( true ) ;
83- expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'HUBAPI.COM' ) ) . toBe ( true ) ;
100+ expect ( hostnameMatchesNoProxyPattern ( 'API.HUBAPI.COM' , 'hubapi.com' ) ) . toBe (
101+ true
102+ ) ;
103+ expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , 'HUBAPI.COM' ) ) . toBe (
104+ true
105+ ) ;
84106 } ) ;
85107
86108 it ( 'trims whitespace from pattern' , ( ) => {
87- expect ( hostnameMatchesNoProxyPattern ( 'localhost' , ' localhost ' ) ) . toBe ( true ) ;
88- expect ( hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , ' .hubapi.com ' ) ) . toBe ( true ) ;
109+ expect ( hostnameMatchesNoProxyPattern ( 'localhost' , ' localhost ' ) ) . toBe (
110+ true
111+ ) ;
112+ expect (
113+ hostnameMatchesNoProxyPattern ( 'api.hubapi.com' , ' .hubapi.com ' )
114+ ) . toBe ( true ) ;
89115 } ) ;
90116} ) ;
91117
0 commit comments