@@ -35,6 +35,7 @@ export type TestFixtures = {
3535 skipRouteHandler ?: boolean ;
3636 skipDsnRouteHandler ?: boolean ;
3737 handleLazyLoadedFeedback ?: boolean ;
38+ responseHeaders ?: Record < string , string > ;
3839 } ) => Promise < string > ;
3940 forceFlushReplay : ( ) => Promise < string > ;
4041 enableConsole : ( ) => void ;
@@ -59,7 +60,13 @@ const sentryTest = base.extend<TestFixtures>({
5960
6061 getLocalTestUrl : ( { page } , use ) => {
6162 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+ } ) => {
6370 const pagePath = `${ TEST_HOST } /index.html` ;
6471
6572 const tmpDir = path . join ( testDir , 'dist' , crypto . randomUUID ( ) ) ;
@@ -86,7 +93,9 @@ const sentryTest = base.extend<TestFixtures>({
8693 const file = route . request ( ) . url ( ) . split ( '/' ) . pop ( ) ;
8794 const filePath = path . resolve ( tmpDir , `./${ file } ` ) ;
8895
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 ( ) ;
9099 } ) ;
91100
92101 if ( handleLazyLoadedFeedback ) {
0 commit comments