@@ -11,7 +11,7 @@ describe('Dsn', () => {
1111 describe ( 'fromComponents' , ( ) => {
1212 test ( 'applies all components' , ( ) => {
1313 const dsn = makeDsn ( {
14- host : 'sentry.io' ,
14+ hostname : 'sentry.io' ,
1515 pass : 'xyz' ,
1616 port : '1234' ,
1717 projectId : '123' ,
@@ -21,23 +21,23 @@ describe('Dsn', () => {
2121 expect ( dsn . protocol ) . toBe ( 'https' ) ;
2222 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
2323 expect ( dsn . pass ) . toBe ( 'xyz' ) ;
24- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
24+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
2525 expect ( dsn . port ) . toBe ( '1234' ) ;
2626 expect ( dsn . path ) . toBe ( '' ) ;
2727 expect ( dsn . projectId ) . toBe ( '123' ) ;
2828 } ) ;
2929
3030 test ( 'applies partial components' , ( ) => {
3131 const dsn = makeDsn ( {
32- host : 'sentry.io' ,
32+ hostname : 'sentry.io' ,
3333 projectId : '123' ,
3434 protocol : 'https' ,
3535 publicKey : 'abc' ,
3636 } ) ;
3737 expect ( dsn . protocol ) . toBe ( 'https' ) ;
3838 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
3939 expect ( dsn . pass ) . toBe ( '' ) ;
40- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
40+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
4141 expect ( dsn . port ) . toBe ( '' ) ;
4242 expect ( dsn . path ) . toBe ( '' ) ;
4343 expect ( dsn . projectId ) . toBe ( '123' ) ;
@@ -46,33 +46,33 @@ describe('Dsn', () => {
4646 testIf ( isDebugBuild ( ) ) ( 'throws for missing components' , ( ) => {
4747 expect ( ( ) =>
4848 makeDsn ( {
49- host : '' ,
49+ hostname : '' ,
5050 projectId : '123' ,
51- protocol : 'https: ' ,
51+ protocol : 'https' ,
5252 publicKey : 'abc' ,
5353 } ) ,
5454 ) . toThrow ( SentryError ) ;
5555 expect ( ( ) =>
5656 makeDsn ( {
57- host : 'sentry.io' ,
57+ hostname : 'sentry.io' ,
5858 projectId : '' ,
59- protocol : 'https: ' ,
59+ protocol : 'https' ,
6060 publicKey : 'abc' ,
6161 } ) ,
6262 ) . toThrow ( SentryError ) ;
6363 expect ( ( ) =>
6464 makeDsn ( {
65- host : 'sentry.io' ,
65+ hostname : 'sentry.io' ,
6666 projectId : '123' ,
6767 protocol : '' as 'http' , // Trick the type checker here
6868 publicKey : 'abc' ,
6969 } ) ,
7070 ) . toThrow ( SentryError ) ;
7171 expect ( ( ) =>
7272 makeDsn ( {
73- host : 'sentry.io' ,
73+ hostname : 'sentry.io' ,
7474 projectId : '123' ,
75- protocol : 'https: ' ,
75+ protocol : 'https' ,
7676 publicKey : '' ,
7777 } ) ,
7878 ) . toThrow ( SentryError ) ;
@@ -81,18 +81,18 @@ describe('Dsn', () => {
8181 testIf ( isDebugBuild ( ) ) ( 'throws for invalid components' , ( ) => {
8282 expect ( ( ) =>
8383 makeDsn ( {
84- host : 'sentry.io' ,
84+ hostname : 'sentry.io' ,
8585 projectId : '123' ,
8686 protocol : 'httpx' as 'http' , // Trick the type checker here
8787 publicKey : 'abc' ,
8888 } ) ,
8989 ) . toThrow ( SentryError ) ;
9090 expect ( ( ) =>
9191 makeDsn ( {
92- host : 'sentry.io' ,
92+ hostname : 'sentry.io' ,
9393 port : 'xxx' ,
9494 projectId : '123' ,
95- protocol : 'https: ' ,
95+ protocol : 'https' ,
9696 publicKey : 'abc' ,
9797 } ) ,
9898 ) . toThrow ( SentryError ) ;
@@ -105,7 +105,7 @@ describe('Dsn', () => {
105105 expect ( dsn . protocol ) . toBe ( 'https' ) ;
106106 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
107107 expect ( dsn . pass ) . toBe ( 'xyz' ) ;
108- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
108+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
109109 expect ( dsn . port ) . toBe ( '1234' ) ;
110110 expect ( dsn . path ) . toBe ( '' ) ;
111111 expect ( dsn . projectId ) . toBe ( '123' ) ;
@@ -116,7 +116,7 @@ describe('Dsn', () => {
116116 expect ( dsn . protocol ) . toBe ( 'https' ) ;
117117 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
118118 expect ( dsn . pass ) . toBe ( '' ) ;
119- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
119+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
120120 expect ( dsn . port ) . toBe ( '' ) ;
121121 expect ( dsn . path ) . toBe ( '/123' ) ;
122122 expect ( dsn . projectId ) . toBe ( '321' ) ;
@@ -127,7 +127,7 @@ describe('Dsn', () => {
127127 expect ( dsn . protocol ) . toBe ( 'https' ) ;
128128 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
129129 expect ( dsn . pass ) . toBe ( '' ) ;
130- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
130+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
131131 expect ( dsn . port ) . toBe ( '' ) ;
132132 expect ( dsn . path ) . toBe ( '/sentry/custom/installation' ) ;
133133 expect ( dsn . projectId ) . toBe ( '321' ) ;
@@ -138,7 +138,7 @@ describe('Dsn', () => {
138138 expect ( dsn . protocol ) . toBe ( 'https' ) ;
139139 expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
140140 expect ( dsn . pass ) . toBe ( '' ) ;
141- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
141+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
142142 expect ( dsn . port ) . toBe ( '' ) ;
143143 expect ( dsn . path ) . toBe ( '' ) ;
144144 expect ( dsn . projectId ) . toBe ( '321' ) ;
0 commit comments