@@ -27,6 +27,10 @@ sentryTest('handles fetch network errors @firefox', async ({ getLocalTestUrl, pa
2727 type : 'onunhandledrejection' ,
2828 } ,
2929 } ) ;
30+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
31+ method : 'GET' ,
32+ url : 'http://sentry-test-external.io/does-not-exist' ,
33+ } ) ;
3034} ) ;
3135
3236
@@ -55,6 +59,10 @@ sentryTest('handles fetch network errors on subdomains @firefox', async ({ getLo
5559 type : 'onunhandledrejection' ,
5660 } ,
5761 } ) ;
62+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
63+ method : 'GET' ,
64+ url : 'http://subdomain.sentry-test-external.io/does-not-exist' ,
65+ } ) ;
5866} ) ;
5967
6068sentryTest ( '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
8593 frames : expect . any ( Array ) ,
8694 } ,
8795 } ) ;
96+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
97+ method : 'GET' ,
98+ url : 'http://sentry-test-external.io/invalid-header-name' ,
99+ } ) ;
88100} ) ;
89101
90102sentryTest ( '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
117129 frames : expect . any ( Array ) ,
118130 } ,
119131 } ) ;
132+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
133+ method : 'GET' ,
134+ url : 'http://sentry-test-external.io/invalid-header-value' ,
135+ } ) ;
120136} ) ;
121137
122138sentryTest ( '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
159175 frames : expect . any ( Array ) ,
160176 } ,
161177 } ) ;
178+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
179+ method : 'GET' ,
180+ url : 'blub://sentry-test-external.io/invalid-scheme' ,
181+ } ) ;
162182} ) ;
163183
164184sentryTest ( '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
171191
172192 const errorMap : Record < string , string > = {
173193 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" , 175195 webkit : 'URL is not valid or contains user credentials.' ,
176196 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.' , 178198 } ;
179199
180200 const error = errorMap [ browserName ] ;
@@ -191,6 +211,10 @@ sentryTest('handles fetch credentials in url errors @firefox', async ({ getLocal
191211 frames : expect . any ( Array ) ,
192212 } ,
193213 } ) ;
214+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
215+ method : 'GET' ,
216+ url :
'https://user:[email protected] /credentials-in-url' , 217+ } ) ;
194218} ) ;
195219
196220sentryTest ( 'handles fetch invalid mode errors @firefox' , async ( { getLocalTestUrl, page, browserName } ) => {
@@ -222,6 +246,10 @@ sentryTest('handles fetch invalid mode errors @firefox', async ({ getLocalTestUr
222246 frames : expect . any ( Array ) ,
223247 } ,
224248 } ) ;
249+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
250+ method : 'GET' ,
251+ url : 'http://sentry-test-external.io/invalid-mode' ,
252+ } ) ;
225253} ) ;
226254
227255sentryTest ( '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
252280 frames : expect . any ( Array ) ,
253281 } ,
254282 } ) ;
283+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
284+ method : 'CONNECT' ,
285+ url : 'http://sentry-test-external.io/invalid-method' ,
286+ } ) ;
255287} ) ;
256288
257289sentryTest (
@@ -284,5 +316,9 @@ sentryTest(
284316 frames : expect . any ( Array ) ,
285317 } ,
286318 } ) ;
319+ expect ( eventData . contexts ?. outgoingRequest ) . toEqual ( {
320+ method : 'PUT' ,
321+ url : 'http://sentry-test-external.io/no-cors-method' ,
322+ } ) ;
287323 } ,
288324) ;
0 commit comments