File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
dev-packages/browser-integration-tests/suites/public-api/startSpan/attributes Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ async function run ( ) {
2
+ Sentry . startSpan ( { name : 'parent_span' } , ( ) => {
3
+ Sentry . startSpan ( { name : 'child_span' , attributes : { someAttribute : '' } } , ( ) => {
4
+ // whatever a user would do here
5
+ } ) ;
6
+ } ) ;
7
+ }
8
+
9
+ ( async ( ) => {
10
+ await run ( ) ;
11
+ } ) ( ) ;
Original file line number Diff line number Diff line change
1
+ import { expect } from '@playwright/test' ;
2
+
3
+ import { sentryTest } from '../../../../utils/fixtures' ;
4
+ import {
5
+ envelopeRequestParser ,
6
+ shouldSkipTracingTest ,
7
+ waitForTransactionRequestOnUrl ,
8
+ } from '../../../../utils/helpers' ;
9
+
10
+ sentryTest ( 'sends an empty string attribute' , async ( { getLocalTestPath, page } ) => {
11
+ if ( shouldSkipTracingTest ( ) ) {
12
+ sentryTest . skip ( ) ;
13
+ }
14
+
15
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
16
+ const req = await waitForTransactionRequestOnUrl ( page , url ) ;
17
+ const transaction = envelopeRequestParser ( req ) ;
18
+
19
+ const childSpan = transaction . spans ?. [ 0 ] ;
20
+ expect ( childSpan ?. data ?. someAttribute ) . toBe ( '' ) ;
21
+ } ) ;
You can’t perform that action at this time.
0 commit comments