@@ -65,18 +65,20 @@ const ANR_EVENT = {
65
65
exception : EXCEPTION ( ) ,
66
66
} ;
67
67
68
- const ANR_EVENT_WITH_DEBUG_META : Event = {
69
- ...ANR_EVENT ,
70
- debug_meta : {
71
- images : [
72
- {
73
- type : 'sourcemap' ,
74
- debug_id : 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa' ,
75
- code_file : expect . stringContaining ( 'basic' ) ,
76
- } ,
77
- ] ,
78
- } ,
79
- } ;
68
+ function ANR_EVENT_WITH_DEBUG_META ( file : string ) : Event {
69
+ return {
70
+ ...ANR_EVENT ,
71
+ debug_meta : {
72
+ images : [
73
+ {
74
+ type : 'sourcemap' ,
75
+ debug_id : 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa' ,
76
+ code_file : expect . stringContaining ( file ) ,
77
+ } ,
78
+ ] ,
79
+ } ,
80
+ } ;
81
+ }
80
82
81
83
describe ( 'Thread Blocked Native' , { timeout : 30_000 } , ( ) => {
82
84
afterAll ( ( ) => {
@@ -86,15 +88,15 @@ describe('Thread Blocked Native', { timeout: 30_000 }, () => {
86
88
test ( 'CJS' , async ( ) => {
87
89
await createRunner ( __dirname , 'basic.js' )
88
90
. withMockSentryServer ( )
89
- . expect ( { event : ANR_EVENT_WITH_DEBUG_META } )
91
+ . expect ( { event : ANR_EVENT_WITH_DEBUG_META ( 'basic' ) } )
90
92
. start ( )
91
93
. completed ( ) ;
92
94
} ) ;
93
95
94
96
test ( 'ESM' , async ( ) => {
95
97
await createRunner ( __dirname , 'basic.mjs' )
96
98
. withMockSentryServer ( )
97
- . expect ( { event : ANR_EVENT_WITH_DEBUG_META } )
99
+ . expect ( { event : ANR_EVENT_WITH_DEBUG_META ( 'basic' ) } )
98
100
. start ( )
99
101
. completed ( ) ;
100
102
} ) ;
@@ -123,8 +125,8 @@ describe('Thread Blocked Native', { timeout: 30_000 }, () => {
123
125
test ( 'multiple events via maxBlockedEvents' , async ( ) => {
124
126
await createRunner ( __dirname , 'basic-multiple.mjs' )
125
127
. withMockSentryServer ( )
126
- . expect ( { event : ANR_EVENT_WITH_DEBUG_META } )
127
- . expect ( { event : ANR_EVENT_WITH_DEBUG_META } )
128
+ . expect ( { event : ANR_EVENT_WITH_DEBUG_META ( 'basic-multiple' ) } )
129
+ . expect ( { event : ANR_EVENT_WITH_DEBUG_META ( 'basic-multiple' ) } )
128
130
. start ( )
129
131
. completed ( ) ;
130
132
} ) ;
0 commit comments