@@ -294,8 +294,8 @@ describe('NodeClient', () => {
294
294
// @ts -ignore accessing private method
295
295
const sendEnvelopeSpy = jest . spyOn ( client , '_sendEnvelope' ) ;
296
296
297
- client . captureCheckIn (
298
- { monitorSlug : 'foo' , status : 'ok' , duration : 1222 } ,
297
+ const id = client . captureCheckIn (
298
+ { monitorSlug : 'foo' , status : 'in_progress' } ,
299
299
{
300
300
schedule : {
301
301
type : 'crontab' ,
@@ -314,10 +314,9 @@ describe('NodeClient', () => {
314
314
[
315
315
expect . any ( Object ) ,
316
316
{
317
- check_in_id : expect . any ( String ) ,
318
- duration : 1222 ,
317
+ check_in_id : id ,
319
318
monitor_slug : 'foo' ,
320
- status : 'ok ' ,
319
+ status : 'in_progress ' ,
321
320
release : '1.0.0' ,
322
321
environment : 'dev' ,
323
322
monitor_config : {
@@ -333,6 +332,26 @@ describe('NodeClient', () => {
333
332
] ,
334
333
] ,
335
334
] ) ;
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
+ ] ) ;
336
355
} ) ;
337
356
338
357
it ( 'does not send a checkIn envelope if disabled' , ( ) => {
@@ -342,7 +361,7 @@ describe('NodeClient', () => {
342
361
// @ts -ignore accessing private method
343
362
const sendEnvelopeSpy = jest . spyOn ( client , '_sendEnvelope' ) ;
344
363
345
- client . captureCheckIn ( { monitorSlug : 'foo' , status : 'ok' , duration : 1222 } ) ;
364
+ client . captureCheckIn ( { monitorSlug : 'foo' , status : 'in_progress' } ) ;
346
365
347
366
expect ( sendEnvelopeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
348
367
} ) ;
0 commit comments