@@ -222,6 +222,14 @@ describe('Hub', () => {
222222 expect ( testClient . captureException . mock . calls [ 0 ] [ 1 ] . event_id ) . toBeTruthy ( ) ;
223223 } ) ;
224224
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+
225233 test ( 'should generate hint if not provided in the call' , ( ) => {
226234 const testClient = makeClient ( ) ;
227235 const hub = new Hub ( testClient ) ;
@@ -248,6 +256,14 @@ describe('Hub', () => {
248256 expect ( testClient . captureMessage . mock . calls [ 0 ] [ 2 ] . event_id ) . toBeTruthy ( ) ;
249257 } ) ;
250258
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+
251267 test ( 'should generate hint if not provided in the call' , ( ) => {
252268 const testClient = makeClient ( ) ;
253269 const hub = new Hub ( testClient ) ;
@@ -279,6 +295,17 @@ describe('Hub', () => {
279295 expect ( testClient . captureEvent . mock . calls [ 0 ] [ 1 ] . event_id ) . toBeTruthy ( ) ;
280296 } ) ;
281297
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+
282309 test ( 'sets lastEventId' , ( ) => {
283310 const event : Event = {
284311 extra : { b : 3 } ,
0 commit comments