@@ -37,14 +37,15 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
37
37
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
38
38
await page . goto ( url ) ;
39
39
40
- const [ , request ] = await Promise . all ( [
40
+ const [ , request , { replayRecordingSnapshots } ] = await Promise . all ( [
41
41
page . evaluate ( ( ) => {
42
42
fetch ( 'http://localhost:7654/foo' ) . then ( ( ) => {
43
43
// @ts -expect-error Sentry is a global
44
44
Sentry . captureException ( 'test error' ) ;
45
45
} ) ;
46
46
} ) ,
47
47
requestPromise ,
48
+ replayRequestPromise ,
48
49
] ) ;
49
50
50
51
const eventData = envelopeRequestParser ( request ) ;
@@ -63,7 +64,6 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
63
64
} ,
64
65
} ) ;
65
66
66
- const { replayRecordingSnapshots } = await replayRequestPromise ;
67
67
expect ( getReplayPerformanceSpans ( replayRecordingSnapshots ) . filter ( span => span . op === 'resource.fetch' ) ) . toEqual ( [
68
68
{
69
69
data : {
@@ -113,14 +113,15 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
113
113
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
114
114
await page . goto ( url ) ;
115
115
116
- const [ , request ] = await Promise . all ( [
116
+ const [ , request , { replayRecordingSnapshots } ] = await Promise . all ( [
117
117
page . evaluate ( ( ) => {
118
118
fetch ( 'http://localhost:7654/foo' ) . then ( ( ) => {
119
119
// @ts -expect-error Sentry is a global
120
120
Sentry . captureException ( 'test error' ) ;
121
121
} ) ;
122
122
} ) ,
123
123
requestPromise ,
124
+ replayRequestPromise ,
124
125
] ) ;
125
126
126
127
const eventData = envelopeRequestParser ( request ) ;
@@ -139,7 +140,6 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
139
140
} ,
140
141
} ) ;
141
142
142
- const { replayRecordingSnapshots } = await replayRequestPromise ;
143
143
expect ( getReplayPerformanceSpans ( replayRecordingSnapshots ) . filter ( span => span . op === 'resource.fetch' ) ) . toEqual ( [
144
144
{
145
145
data : {
@@ -195,14 +195,15 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
195
195
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
196
196
await page . goto ( url ) ;
197
197
198
- const [ , request ] = await Promise . all ( [
198
+ const [ , request , { replayRecordingSnapshots } ] = await Promise . all ( [
199
199
page . evaluate ( ( ) => {
200
200
fetch ( 'http://localhost:7654/bar' ) . then ( ( ) => {
201
201
// @ts -expect-error Sentry is a global
202
202
Sentry . captureException ( 'test error' ) ;
203
203
} ) ;
204
204
} ) ,
205
205
requestPromise ,
206
+ replayRequestPromise ,
206
207
] ) ;
207
208
208
209
const eventData = envelopeRequestParser ( request ) ;
@@ -221,7 +222,6 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
221
222
} ,
222
223
} ) ;
223
224
224
- const { replayRecordingSnapshots } = await replayRequestPromise ;
225
225
expect ( getReplayPerformanceSpans ( replayRecordingSnapshots ) . filter ( span => span . op === 'resource.fetch' ) ) . toEqual ( [
226
226
{
227
227
data : {
0 commit comments