@@ -27,6 +27,10 @@ sentryTest('handles fetch network errors @firefox', async ({ getLocalTestUrl, pa
27
27
type : 'onunhandledrejection' ,
28
28
} ,
29
29
} ) ;
30
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
31
+ method : 'GET' ,
32
+ url : 'http://sentry-test-external.io/does-not-exist' ,
33
+ } ) ;
30
34
} ) ;
31
35
32
36
@@ -55,6 +59,10 @@ sentryTest('handles fetch network errors on subdomains @firefox', async ({ getLo
55
59
type : 'onunhandledrejection' ,
56
60
} ,
57
61
} ) ;
62
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
63
+ method : 'GET' ,
64
+ url : 'http://subdomain.sentry-test-external.io/does-not-exist' ,
65
+ } ) ;
58
66
} ) ;
59
67
60
68
sentryTest ( 'handles fetch invalid header name errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -85,6 +93,10 @@ sentryTest('handles fetch invalid header name errors @firefox', async ({ getLoca
85
93
frames : expect . any ( Array ) ,
86
94
} ,
87
95
} ) ;
96
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
97
+ method : 'GET' ,
98
+ url : 'http://sentry-test-external.io/invalid-header-name' ,
99
+ } ) ;
88
100
} ) ;
89
101
90
102
sentryTest ( 'handles fetch invalid header value errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -117,6 +129,10 @@ sentryTest('handles fetch invalid header value errors @firefox', async ({ getLoc
117
129
frames : expect . any ( Array ) ,
118
130
} ,
119
131
} ) ;
132
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
133
+ method : 'GET' ,
134
+ url : 'http://sentry-test-external.io/invalid-header-value' ,
135
+ } ) ;
120
136
} ) ;
121
137
122
138
sentryTest ( 'handles fetch invalid URL scheme errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -159,6 +175,10 @@ sentryTest('handles fetch invalid URL scheme errors @firefox', async ({ getLocal
159
175
frames : expect . any ( Array ) ,
160
176
} ,
161
177
} ) ;
178
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
179
+ method : 'GET' ,
180
+ url : 'blub://sentry-test-external.io/invalid-scheme' ,
181
+ } ) ;
162
182
} ) ;
163
183
164
184
sentryTest ( 'handles fetch credentials in url errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -171,10 +191,10 @@ sentryTest('handles fetch credentials in url errors @firefox', async ({ getLocal
171
191
172
192
const errorMap : Record < string , string > = {
173
193
chromium :
174
- "Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: https ://user:[email protected] /credentials-in-url" ,
194
+ "Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: http ://user:[email protected] /credentials-in-url" ,
175
195
webkit : 'URL is not valid or contains user credentials.' ,
176
196
firefox :
177
- 'Window.fetch: https ://user:[email protected] /credentials-in-url is an url with embedded credentials.' ,
197
+ 'Window.fetch: http ://user:[email protected] /credentials-in-url is an url with embedded credentials.' ,
178
198
} ;
179
199
180
200
const error = errorMap [ browserName ] ;
@@ -191,6 +211,10 @@ sentryTest('handles fetch credentials in url errors @firefox', async ({ getLocal
191
211
frames : expect . any ( Array ) ,
192
212
} ,
193
213
} ) ;
214
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
215
+ method : 'GET' ,
216
+ url :
'https://user:[email protected] /credentials-in-url' ,
217
+ } ) ;
194
218
} ) ;
195
219
196
220
sentryTest ( 'handles fetch invalid mode errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -222,6 +246,10 @@ sentryTest('handles fetch invalid mode errors @firefox', async ({ getLocalTestUr
222
246
frames : expect . any ( Array ) ,
223
247
} ,
224
248
} ) ;
249
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
250
+ method : 'GET' ,
251
+ url : 'http://sentry-test-external.io/invalid-mode' ,
252
+ } ) ;
225
253
} ) ;
226
254
227
255
sentryTest ( 'handles fetch invalid request method errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -252,6 +280,10 @@ sentryTest('handles fetch invalid request method errors @firefox', async ({ getL
252
280
frames : expect . any ( Array ) ,
253
281
} ,
254
282
} ) ;
283
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
284
+ method : 'CONNECT' ,
285
+ url : 'http://sentry-test-external.io/invalid-method' ,
286
+ } ) ;
255
287
} ) ;
256
288
257
289
sentryTest (
@@ -284,5 +316,9 @@ sentryTest(
284
316
frames : expect . any ( Array ) ,
285
317
} ,
286
318
} ) ;
319
+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
320
+ method : 'PUT' ,
321
+ url : 'http://sentry-test-external.io/no-cors-method' ,
322
+ } ) ;
287
323
} ,
288
324
) ;
0 commit comments