File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
dev-packages/node-integration-tests Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change
1
+ import type { TransactionEvent } from '@sentry/types' ;
1
2
import { cleanupChildProcesses , createRunner } from '../../../utils/runner' ;
2
3
3
4
jest . setTimeout ( 30_000 ) ;
@@ -35,16 +36,16 @@ describe('amqplib auto-instrumentation', () => {
35
36
readyMatches : [ 'Time to start RabbitMQ' ] ,
36
37
} )
37
38
. expect ( {
38
- transaction : ( transaction : any ) => {
39
+ transaction : ( transaction : TransactionEvent ) => {
39
40
expect ( transaction . transaction ) . toEqual ( 'Test Server Start1' ) ;
40
- expect ( transaction . spans . length ) . toEqual ( 1 ) ;
41
- expect ( transaction . spans [ 0 ] ) . toMatchObject ( EXPECTED_MESSAGE_SPAN_PRODUCER ) ;
41
+ expect ( transaction . spans ? .length ) . toEqual ( 1 ) ;
42
+ expect ( transaction . spans ! [ 0 ] ) . toMatchObject ( EXPECTED_MESSAGE_SPAN_PRODUCER ) ;
42
43
} ,
43
44
} )
44
45
. expect ( {
45
- transaction : ( transaction : any ) => {
46
+ transaction : ( transaction : TransactionEvent ) => {
46
47
expect ( transaction . transaction ) . toEqual ( 'queue1 process' ) ;
47
- expect ( transaction . contexts . trace ) . toMatchObject ( EXPECTED_MESSAGE_SPAN_CONSUMER ) ;
48
+ expect ( transaction . contexts ? .trace ) . toMatchObject ( EXPECTED_MESSAGE_SPAN_CONSUMER ) ;
48
49
} ,
49
50
} )
50
51
. start ( done ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import type {
11
11
SerializedCheckIn ,
12
12
SerializedSession ,
13
13
SessionAggregates ,
14
+ TransactionEvent ,
14
15
} from '@sentry/types' ;
15
16
import axios from 'axios' ;
16
17
import { createBasicSentryServer } from './server' ;
@@ -151,7 +152,7 @@ type Expected =
151
152
event : Partial < Event > | ( ( event : Event ) => void ) ;
152
153
}
153
154
| {
154
- transaction : Partial < Event > | ( ( event : Event ) => void ) ;
155
+ transaction : Partial < TransactionEvent > | ( ( event : TransactionEvent ) => void ) ;
155
156
}
156
157
| {
157
158
session : Partial < SerializedSession > | ( ( event : SerializedSession ) => void ) ;
@@ -317,7 +318,7 @@ export function createRunner(...paths: string[]) {
317
318
}
318
319
319
320
if ( 'transaction' in expected ) {
320
- const event = item [ 1 ] as Event ;
321
+ const event = item [ 1 ] as TransactionEvent ;
321
322
if ( typeof expected . transaction === 'function' ) {
322
323
expected . transaction ( event ) ;
323
324
} else {
You can’t perform that action at this time.
0 commit comments