Skip to content

Commit f57e14c

Browse files
author
Luca Forstner
committed
fix test
1 parent 3f782ca commit f57e14c

File tree

2 files changed

+9
-7
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/on-request-span-start

2 files changed

+9
-7
lines changed

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/on-request-span-start/init.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Sentry.init({
88
Sentry.browserTracingIntegration({
99
idleTimeout: 1000,
1010
onRequestSpanStart(span, { headers }) {
11-
span.setAttribute('hook.called.headers', headers.get('foo'));
11+
if (headers) {
12+
span.setAttribute('hook.called.headers', headers.get('foo'));
13+
}
1214
},
1315
}),
1416
],

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/on-request-span-start/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ sentryTest('should call onRequestSpanStart hook', async ({ browserName, getLocal
3535
expect(tracingEvent.spans).toContainEqual(
3636
expect.objectContaining({
3737
op: 'http.client',
38-
data: {
39-
'hook.called.headers': 'fetch',
40-
},
38+
data: expect.objectContaining({
39+
'hook.called.headers': 'xhr',
40+
}),
4141
}),
4242
);
4343

4444
expect(tracingEvent.spans).toContainEqual(
4545
expect.objectContaining({
4646
op: 'http.client',
47-
data: {
48-
'hook.called.headers': 'xhr',
49-
},
47+
data: expect.objectContaining({
48+
'hook.called.headers': 'fetch',
49+
}),
5050
}),
5151
);
5252
});

0 commit comments

Comments
 (0)