Skip to content

Commit 4c6aa9c

Browse files
committed
collectReplayRequests
1 parent ad4a26a commit 4c6aa9c

File tree

1 file changed

+6
-6
lines changed
  • dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders

1 file changed

+6
-6
lines changed

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
3737
const url = await getLocalTestPath({ testDir: __dirname });
3838
await page.goto(url);
3939

40-
const [, request] = await Promise.all([
40+
const [, request, {replayRecordingSnapshots}] = await Promise.all([
4141
page.evaluate(() => {
4242
fetch('http://localhost:7654/foo').then(() => {
4343
// @ts-expect-error Sentry is a global
4444
Sentry.captureException('test error');
4545
});
4646
}),
4747
requestPromise,
48+
replayRequestPromise,
4849
]);
4950

5051
const eventData = envelopeRequestParser(request);
@@ -63,7 +64,6 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
6364
},
6465
});
6566

66-
const { replayRecordingSnapshots } = await replayRequestPromise;
6767
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
6868
{
6969
data: {
@@ -113,14 +113,15 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
113113
const url = await getLocalTestPath({ testDir: __dirname });
114114
await page.goto(url);
115115

116-
const [, request] = await Promise.all([
116+
const [, request, {replayRecordingSnapshots}] = await Promise.all([
117117
page.evaluate(() => {
118118
fetch('http://localhost:7654/foo').then(() => {
119119
// @ts-expect-error Sentry is a global
120120
Sentry.captureException('test error');
121121
});
122122
}),
123123
requestPromise,
124+
replayRequestPromise,
124125
]);
125126

126127
const eventData = envelopeRequestParser(request);
@@ -139,7 +140,6 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
139140
},
140141
});
141142

142-
const { replayRecordingSnapshots } = await replayRequestPromise;
143143
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
144144
{
145145
data: {
@@ -195,14 +195,15 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
195195
const url = await getLocalTestPath({ testDir: __dirname });
196196
await page.goto(url);
197197

198-
const [, request] = await Promise.all([
198+
const [, request, {replayRecordingSnapshots}] = await Promise.all([
199199
page.evaluate(() => {
200200
fetch('http://localhost:7654/bar').then(() => {
201201
// @ts-expect-error Sentry is a global
202202
Sentry.captureException('test error');
203203
});
204204
}),
205205
requestPromise,
206+
replayRequestPromise,
206207
]);
207208

208209
const eventData = envelopeRequestParser(request);
@@ -221,7 +222,6 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
221222
},
222223
});
223224

224-
const { replayRecordingSnapshots } = await replayRequestPromise;
225225
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
226226
{
227227
data: {

0 commit comments

Comments
 (0)