Skip to content

Commit 8e7d80f

Browse files
committed
make transactions accept metadata in their incoming transaction context
1 parent 55f87b7 commit 8e7d80f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/tracing/test/hub.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,29 @@ describe('Hub', () => {
2828
jest.clearAllMocks();
2929
});
3030

31+
describe('transaction creation', () => {
32+
const hub = new Hub(
33+
new BrowserClient({
34+
dsn: 'https://[email protected]/12312012',
35+
environment: 'dogpark',
36+
release: 'off.leash.trail',
37+
}),
38+
);
39+
40+
it('uses inherited values when given in transaction context', () => {
41+
const transactionContext = {
42+
name: 'FETCH /ball',
43+
traceId: '12312012123120121231201212312012',
44+
parentSpanId: '1121201211212012',
45+
metadata: { tracestate: { sentry: 'sentry=doGsaREgReaT', thirdparty: 'maisey=silly;charlie=goofy' } },
46+
};
47+
48+
const transaction = hub.startTransaction(transactionContext);
49+
50+
expect(transaction).toEqual(expect.objectContaining(transactionContext));
51+
});
52+
});
53+
3154
describe('getTransaction()', () => {
3255
it('should find a transaction which has been set on the scope if sampled = true', () => {
3356
const hub = new Hub(new BrowserClient({ tracesSampleRate: 1 }));

0 commit comments

Comments
 (0)