@@ -222,6 +222,14 @@ describe('Hub', () => {
222
222
expect ( testClient . captureException . mock . calls [ 0 ] [ 1 ] . event_id ) . toBeTruthy ( ) ;
223
223
} ) ;
224
224
225
+ test ( 'should keep event_id from hint' , ( ) => {
226
+ const testClient = makeClient ( ) ;
227
+ const hub = new Hub ( testClient ) ;
228
+ const id = Math . random ( ) . toString ( ) ;
229
+ hub . captureException ( 'a' , { event_id : id } ) ;
230
+ expect ( testClient . captureException . mock . calls [ 0 ] [ 1 ] . event_id ) . toBe ( id ) ;
231
+ } ) ;
232
+
225
233
test ( 'should generate hint if not provided in the call' , ( ) => {
226
234
const testClient = makeClient ( ) ;
227
235
const hub = new Hub ( testClient ) ;
@@ -248,6 +256,14 @@ describe('Hub', () => {
248
256
expect ( testClient . captureMessage . mock . calls [ 0 ] [ 2 ] . event_id ) . toBeTruthy ( ) ;
249
257
} ) ;
250
258
259
+ test ( 'should keep event_id from hint' , ( ) => {
260
+ const testClient = makeClient ( ) ;
261
+ const hub = new Hub ( testClient ) ;
262
+ const id = Math . random ( ) . toString ( ) ;
263
+ hub . captureMessage ( 'a' , undefined , { event_id : id } ) ;
264
+ expect ( testClient . captureMessage . mock . calls [ 0 ] [ 2 ] . event_id ) . toBe ( id ) ;
265
+ } ) ;
266
+
251
267
test ( 'should generate hint if not provided in the call' , ( ) => {
252
268
const testClient = makeClient ( ) ;
253
269
const hub = new Hub ( testClient ) ;
@@ -279,6 +295,17 @@ describe('Hub', () => {
279
295
expect ( testClient . captureEvent . mock . calls [ 0 ] [ 1 ] . event_id ) . toBeTruthy ( ) ;
280
296
} ) ;
281
297
298
+ test ( 'should keep event_id from hint' , ( ) => {
299
+ const event : Event = {
300
+ extra : { b : 3 } ,
301
+ } ;
302
+ const testClient = makeClient ( ) ;
303
+ const hub = new Hub ( testClient ) ;
304
+ const id = Math . random ( ) . toString ( ) ;
305
+ hub . captureEvent ( event , { event_id : id } ) ;
306
+ expect ( testClient . captureEvent . mock . calls [ 0 ] [ 1 ] . event_id ) . toBe ( id ) ;
307
+ } ) ;
308
+
282
309
test ( 'sets lastEventId' , ( ) => {
283
310
const event : Event = {
284
311
extra : { b : 3 } ,
0 commit comments