@@ -3,34 +3,29 @@ import { waitForTransaction } from '@sentry-internal/test-utils';
33
44test ( 'Sends an HTTP transaction' , async ( { baseURL } ) => {
55 const transactionEventPromise = waitForTransaction ( 'effect-node' , transactionEvent => {
6- return (
7- transactionEvent ?. contexts ?. trace ?. op === 'http.server' &&
8- transactionEvent ?. transaction ?. includes ( '/test-success' )
9- ) ;
6+ return transactionEvent ?. transaction === 'http.server GET' ;
107 } ) ;
118
129 await fetch ( `${ baseURL } /test-success` ) ;
1310
1411 const transactionEvent = await transactionEventPromise ;
1512
16- expect ( transactionEvent . contexts ?. trace ?. op ) . toBe ( 'http.server' ) ;
17- expect ( transactionEvent . transaction ) . toContain ( '/test-success' ) ;
13+ expect ( transactionEvent . transaction ) . toBe ( 'http.server GET' ) ;
1814} ) ;
1915
2016test ( 'Sends transaction with manual Effect span' , async ( { baseURL } ) => {
2117 const transactionEventPromise = waitForTransaction ( 'effect-node' , transactionEvent => {
2218 return (
23- transactionEvent ?. contexts ?. trace ?. op === 'http.server' &&
24- transactionEvent ?. transaction ?. includes ( '/ test-transaction ')
19+ transactionEvent ?. transaction === 'http.server GET ' &&
20+ transactionEvent ?. spans ?. some ( span => span . description === ' test-span ')
2521 ) ;
2622 } ) ;
2723
2824 await fetch ( `${ baseURL } /test-transaction` ) ;
2925
3026 const transactionEvent = await transactionEventPromise ;
3127
32- expect ( transactionEvent . contexts ?. trace ?. op ) . toBe ( 'http.server' ) ;
33- expect ( transactionEvent . transaction ) . toContain ( '/test-transaction' ) ;
28+ expect ( transactionEvent . transaction ) . toBe ( 'http.server GET' ) ;
3429
3530 const spans = transactionEvent . spans || [ ] ;
3631 expect ( spans ) . toContainEqual (
@@ -43,24 +38,22 @@ test('Sends transaction with manual Effect span', async ({ baseURL }) => {
4338test ( 'Sends Effect spans with correct parent-child structure' , async ( { baseURL } ) => {
4439 const transactionEventPromise = waitForTransaction ( 'effect-node' , transactionEvent => {
4540 return (
46- transactionEvent ?. contexts ?. trace ?. op === 'http.server' &&
47- transactionEvent ?. transaction ?. includes ( '/test -effect-span')
41+ transactionEvent ?. transaction === 'http.server GET ' &&
42+ transactionEvent ?. spans ?. some ( span => span . description === 'custom -effect-span')
4843 ) ;
4944 } ) ;
5045
5146 await fetch ( `${ baseURL } /test-effect-span` ) ;
5247
5348 const transactionEvent = await transactionEventPromise ;
5449
55- expect ( transactionEvent . contexts ?. trace ?. op ) . toBe ( 'http.server' ) ;
56- expect ( transactionEvent . transaction ) . toContain ( '/test-effect-span' ) ;
50+ expect ( transactionEvent . transaction ) . toBe ( 'http.server GET' ) ;
5751
5852 const spans = transactionEvent . spans || [ ] ;
5953
6054 expect ( spans ) . toContainEqual (
6155 expect . objectContaining ( {
6256 description : 'custom-effect-span' ,
63- op : 'internal' ,
6457 } ) ,
6558 ) ;
6659
@@ -77,15 +70,12 @@ test('Sends Effect spans with correct parent-child structure', async ({ baseURL
7770
7871test ( 'Sends transaction for error route' , async ( { baseURL } ) => {
7972 const transactionEventPromise = waitForTransaction ( 'effect-node' , transactionEvent => {
80- return (
81- transactionEvent ?. contexts ?. trace ?. op === 'http.server' && transactionEvent ?. transaction ?. includes ( '/test-error' )
82- ) ;
73+ return transactionEvent ?. transaction === 'http.server GET' ;
8374 } ) ;
8475
8576 await fetch ( `${ baseURL } /test-error` ) ;
8677
8778 const transactionEvent = await transactionEventPromise ;
8879
89- expect ( transactionEvent . contexts ?. trace ?. op ) . toBe ( 'http.server' ) ;
90- expect ( transactionEvent . transaction ) . toContain ( '/test-error' ) ;
80+ expect ( transactionEvent . transaction ) . toBe ( 'http.server GET' ) ;
9181} ) ;
0 commit comments