File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
packages/integration-tests/suites/public-api/startTransaction Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ const chicken = { } ;
2+ const egg = { contains : chicken } ;
3+ chicken . lays = egg ;
4+
5+ const circularObject = chicken ;
6+
7+ const transaction = Sentry . startTransaction ( { name : 'circular_object_test_transaction' , data : circularObject } ) ;
8+ const span = transaction . startChild ( { op : 'circular_object_test_span' , data : circularObject } ) ;
9+
10+ span . finish ( ) ;
11+ transaction . finish ( ) ;
Original file line number Diff line number Diff line change 1+ import { expect } from '@playwright/test' ;
2+ import { Event } from '@sentry/types' ;
3+
4+ import { sentryTest } from '../../../../utils/fixtures' ;
5+ import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers' ;
6+
7+ sentryTest ( 'should be able to handle circular data' , async ( { getLocalTestPath, page } ) => {
8+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
9+ const eventData = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
10+
11+ expect ( eventData . type ) . toBe ( 'transaction' ) ;
12+ expect ( eventData . transaction ) . toBe ( 'circular_object_test_transaction' ) ;
13+
14+ expect ( eventData . contexts ) . toMatchObject ( {
15+ trace : {
16+ data : { lays : { contains : { lays : { contains : '[Circular ~]' } } } } ,
17+ } ,
18+ } ) ;
19+
20+ expect ( eventData ?. spans ?. [ 0 ] ) . toMatchObject ( {
21+ data : { lays : { contains : '[Circular ~]' } } ,
22+ op : 'circular_object_test_span' ,
23+ } ) ;
24+
25+ await new Promise ( resolve => setTimeout ( resolve , 2000 ) ) ;
26+ } ) ;
Original file line number Diff line number Diff line change @@ -7,4 +7,5 @@ window.Sentry = Sentry;
77Sentry . init ( {
88 dsn :
'https://[email protected] /1337' , 99 tracesSampleRate : 1.0 ,
10+ normalizeDepth : 10 ,
1011} ) ;
You can’t perform that action at this time.
0 commit comments