@@ -294,8 +294,8 @@ describe('NodeClient', () => {
294294 // @ts -ignore accessing private method
295295 const sendEnvelopeSpy = jest . spyOn ( client , '_sendEnvelope' ) ;
296296
297- client . captureCheckIn (
298- { monitorSlug : 'foo' , status : 'ok' , duration : 1222 } ,
297+ const id = client . captureCheckIn (
298+ { monitorSlug : 'foo' , status : 'in_progress' } ,
299299 {
300300 schedule : {
301301 type : 'crontab' ,
@@ -314,10 +314,9 @@ describe('NodeClient', () => {
314314 [
315315 expect . any ( Object ) ,
316316 {
317- check_in_id : expect . any ( String ) ,
318- duration : 1222 ,
317+ check_in_id : id ,
319318 monitor_slug : 'foo' ,
320- status : 'ok ' ,
319+ status : 'in_progress ' ,
321320 release : '1.0.0' ,
322321 environment : 'dev' ,
323322 monitor_config : {
@@ -333,6 +332,26 @@ describe('NodeClient', () => {
333332 ] ,
334333 ] ,
335334 ] ) ;
335+
336+ client . captureCheckIn ( { monitorSlug : 'foo' , status : 'ok' , duration : 1222 , checkInId : id } ) ;
337+
338+ expect ( sendEnvelopeSpy ) . toHaveBeenCalledTimes ( 2 ) ;
339+ expect ( sendEnvelopeSpy ) . toHaveBeenCalledWith ( [
340+ expect . any ( Object ) ,
341+ [
342+ [
343+ expect . any ( Object ) ,
344+ {
345+ check_in_id : id ,
346+ monitor_slug : 'foo' ,
347+ duration : 1222 ,
348+ status : 'ok' ,
349+ release : '1.0.0' ,
350+ environment : 'dev' ,
351+ } ,
352+ ] ,
353+ ] ,
354+ ] ) ;
336355 } ) ;
337356
338357 it ( 'does not send a checkIn envelope if disabled' , ( ) => {
@@ -342,7 +361,7 @@ describe('NodeClient', () => {
342361 // @ts -ignore accessing private method
343362 const sendEnvelopeSpy = jest . spyOn ( client , '_sendEnvelope' ) ;
344363
345- client . captureCheckIn ( { monitorSlug : 'foo' , status : 'ok' , duration : 1222 } ) ;
364+ client . captureCheckIn ( { monitorSlug : 'foo' , status : 'in_progress' } ) ;
346365
347366 expect ( sendEnvelopeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
348367 } ) ;
0 commit comments