@@ -11,7 +11,7 @@ describe('Dsn', () => {
11
11
describe ( 'fromComponents' , ( ) => {
12
12
test ( 'applies all components' , ( ) => {
13
13
const dsn = makeDsn ( {
14
- host : 'sentry.io' ,
14
+ hostname : 'sentry.io' ,
15
15
pass : 'xyz' ,
16
16
port : '1234' ,
17
17
projectId : '123' ,
@@ -21,23 +21,23 @@ describe('Dsn', () => {
21
21
expect ( dsn . protocol ) . toBe ( 'https' ) ;
22
22
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
23
23
expect ( dsn . pass ) . toBe ( 'xyz' ) ;
24
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
24
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
25
25
expect ( dsn . port ) . toBe ( '1234' ) ;
26
26
expect ( dsn . path ) . toBe ( '' ) ;
27
27
expect ( dsn . projectId ) . toBe ( '123' ) ;
28
28
} ) ;
29
29
30
30
test ( 'applies partial components' , ( ) => {
31
31
const dsn = makeDsn ( {
32
- host : 'sentry.io' ,
32
+ hostname : 'sentry.io' ,
33
33
projectId : '123' ,
34
34
protocol : 'https' ,
35
35
publicKey : 'abc' ,
36
36
} ) ;
37
37
expect ( dsn . protocol ) . toBe ( 'https' ) ;
38
38
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
39
39
expect ( dsn . pass ) . toBe ( '' ) ;
40
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
40
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
41
41
expect ( dsn . port ) . toBe ( '' ) ;
42
42
expect ( dsn . path ) . toBe ( '' ) ;
43
43
expect ( dsn . projectId ) . toBe ( '123' ) ;
@@ -46,33 +46,33 @@ describe('Dsn', () => {
46
46
testIf ( isDebugBuild ( ) ) ( 'throws for missing components' , ( ) => {
47
47
expect ( ( ) =>
48
48
makeDsn ( {
49
- host : '' ,
49
+ hostname : '' ,
50
50
projectId : '123' ,
51
- protocol : 'https: ' ,
51
+ protocol : 'https' ,
52
52
publicKey : 'abc' ,
53
53
} ) ,
54
54
) . toThrow ( SentryError ) ;
55
55
expect ( ( ) =>
56
56
makeDsn ( {
57
- host : 'sentry.io' ,
57
+ hostname : 'sentry.io' ,
58
58
projectId : '' ,
59
- protocol : 'https: ' ,
59
+ protocol : 'https' ,
60
60
publicKey : 'abc' ,
61
61
} ) ,
62
62
) . toThrow ( SentryError ) ;
63
63
expect ( ( ) =>
64
64
makeDsn ( {
65
- host : 'sentry.io' ,
65
+ hostname : 'sentry.io' ,
66
66
projectId : '123' ,
67
67
protocol : '' as 'http' , // Trick the type checker here
68
68
publicKey : 'abc' ,
69
69
} ) ,
70
70
) . toThrow ( SentryError ) ;
71
71
expect ( ( ) =>
72
72
makeDsn ( {
73
- host : 'sentry.io' ,
73
+ hostname : 'sentry.io' ,
74
74
projectId : '123' ,
75
- protocol : 'https: ' ,
75
+ protocol : 'https' ,
76
76
publicKey : '' ,
77
77
} ) ,
78
78
) . toThrow ( SentryError ) ;
@@ -81,18 +81,18 @@ describe('Dsn', () => {
81
81
testIf ( isDebugBuild ( ) ) ( 'throws for invalid components' , ( ) => {
82
82
expect ( ( ) =>
83
83
makeDsn ( {
84
- host : 'sentry.io' ,
84
+ hostname : 'sentry.io' ,
85
85
projectId : '123' ,
86
86
protocol : 'httpx' as 'http' , // Trick the type checker here
87
87
publicKey : 'abc' ,
88
88
} ) ,
89
89
) . toThrow ( SentryError ) ;
90
90
expect ( ( ) =>
91
91
makeDsn ( {
92
- host : 'sentry.io' ,
92
+ hostname : 'sentry.io' ,
93
93
port : 'xxx' ,
94
94
projectId : '123' ,
95
- protocol : 'https: ' ,
95
+ protocol : 'https' ,
96
96
publicKey : 'abc' ,
97
97
} ) ,
98
98
) . toThrow ( SentryError ) ;
@@ -105,7 +105,7 @@ describe('Dsn', () => {
105
105
expect ( dsn . protocol ) . toBe ( 'https' ) ;
106
106
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
107
107
expect ( dsn . pass ) . toBe ( 'xyz' ) ;
108
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
108
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
109
109
expect ( dsn . port ) . toBe ( '1234' ) ;
110
110
expect ( dsn . path ) . toBe ( '' ) ;
111
111
expect ( dsn . projectId ) . toBe ( '123' ) ;
@@ -116,7 +116,7 @@ describe('Dsn', () => {
116
116
expect ( dsn . protocol ) . toBe ( 'https' ) ;
117
117
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
118
118
expect ( dsn . pass ) . toBe ( '' ) ;
119
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
119
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
120
120
expect ( dsn . port ) . toBe ( '' ) ;
121
121
expect ( dsn . path ) . toBe ( '/123' ) ;
122
122
expect ( dsn . projectId ) . toBe ( '321' ) ;
@@ -127,7 +127,7 @@ describe('Dsn', () => {
127
127
expect ( dsn . protocol ) . toBe ( 'https' ) ;
128
128
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
129
129
expect ( dsn . pass ) . toBe ( '' ) ;
130
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
130
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
131
131
expect ( dsn . port ) . toBe ( '' ) ;
132
132
expect ( dsn . path ) . toBe ( '/sentry/custom/installation' ) ;
133
133
expect ( dsn . projectId ) . toBe ( '321' ) ;
@@ -138,7 +138,7 @@ describe('Dsn', () => {
138
138
expect ( dsn . protocol ) . toBe ( 'https' ) ;
139
139
expect ( dsn . publicKey ) . toBe ( 'abc' ) ;
140
140
expect ( dsn . pass ) . toBe ( '' ) ;
141
- expect ( dsn . host ) . toBe ( 'sentry.io' ) ;
141
+ expect ( dsn . hostname ) . toBe ( 'sentry.io' ) ;
142
142
expect ( dsn . port ) . toBe ( '' ) ;
143
143
expect ( dsn . path ) . toBe ( '' ) ;
144
144
expect ( dsn . projectId ) . toBe ( '321' ) ;
0 commit comments