@@ -35,6 +35,7 @@ export type TestFixtures = {
35
35
skipRouteHandler ?: boolean ;
36
36
skipDsnRouteHandler ?: boolean ;
37
37
handleLazyLoadedFeedback ?: boolean ;
38
+ responseHeaders ?: Record < string , string > ;
38
39
} ) => Promise < string > ;
39
40
forceFlushReplay : ( ) => Promise < string > ;
40
41
enableConsole : ( ) => void ;
@@ -59,7 +60,13 @@ const sentryTest = base.extend<TestFixtures>({
59
60
60
61
getLocalTestUrl : ( { page } , use ) => {
61
62
return use (
62
- async ( { testDir, skipRouteHandler = false , skipDsnRouteHandler = false , handleLazyLoadedFeedback = false } ) => {
63
+ async ( {
64
+ testDir,
65
+ skipRouteHandler = false ,
66
+ skipDsnRouteHandler = false ,
67
+ handleLazyLoadedFeedback = false ,
68
+ responseHeaders = { } ,
69
+ } ) => {
63
70
const pagePath = `${ TEST_HOST } /index.html` ;
64
71
65
72
const tmpDir = path . join ( testDir , 'dist' , crypto . randomUUID ( ) ) ;
@@ -86,7 +93,9 @@ const sentryTest = base.extend<TestFixtures>({
86
93
const file = route . request ( ) . url ( ) . split ( '/' ) . pop ( ) ;
87
94
const filePath = path . resolve ( tmpDir , `./${ file } ` ) ;
88
95
89
- return fs . existsSync ( filePath ) ? route . fulfill ( { path : filePath } ) : route . continue ( ) ;
96
+ return fs . existsSync ( filePath )
97
+ ? route . fulfill ( { path : filePath , headers : responseHeaders } )
98
+ : route . continue ( ) ;
90
99
} ) ;
91
100
92
101
if ( handleLazyLoadedFeedback ) {
0 commit comments