@@ -377,7 +377,7 @@ describe('SentryNode initialization', () => {
377
377
defaultIntegrations : [ new MockIntegration ( 'bar' ) ] ,
378
378
} ) ;
379
379
const integrations = ( initAndBind as jest . Mock ) . mock . calls [ 0 ] [ 1 ] . defaultIntegrations ;
380
- expect ( integrations . map ( i => i . name ) ) . toEqual ( [ 'bar' , 'foo' ] ) ;
380
+ expect ( integrations . map ( ( i : { name : string } ) => i . name ) ) . toEqual ( [ 'bar' , 'foo' ] ) ;
381
381
} ) ;
382
382
} ) ;
383
383
@@ -387,7 +387,7 @@ describe('SentryNode initialization', () => {
387
387
defaultIntegrations : [ new MockIntegration ( 'baz' ) , new MockIntegration ( 'qux' ) ] ,
388
388
} ) ;
389
389
const integrations = ( initAndBind as jest . Mock ) . mock . calls [ 0 ] [ 1 ] . defaultIntegrations ;
390
- expect ( integrations . map ( i => i . name ) ) . toEqual ( [ 'baz' , 'qux' , 'foo' , 'bar' ] ) ;
390
+ expect ( integrations . map ( ( i : { name : string } ) => i . name ) ) . toEqual ( [ 'baz' , 'qux' , 'foo' , 'bar' ] ) ;
391
391
} ) ;
392
392
} ) ;
393
393
@@ -401,4 +401,25 @@ describe('SentryNode initialization', () => {
401
401
} ) ;
402
402
} ) ;
403
403
} ) ;
404
+
405
+ describe ( 'autoSessionTracking' , ( ) => {
406
+ it ( 'enables autoSessionTracking if there is a release' , ( ) => {
407
+ init ( {
408
+ dsn : '' ,
409
+ release : '3.5.7' ,
410
+ } ) ;
411
+
412
+ const options = ( initAndBind as jest . Mock ) . mock . calls [ 0 ] [ 1 ] ;
413
+ expect ( options . autoSessionTracking ) . toBe ( true ) ;
414
+ } ) ;
415
+
416
+ it ( 'disables autoSessionTracking if dsn is undefined' , ( ) => {
417
+ init ( {
418
+ release : '3.5.7' ,
419
+ } ) ;
420
+
421
+ const options = ( initAndBind as jest . Mock ) . mock . calls [ 0 ] [ 1 ] ;
422
+ expect ( options . autoSessionTracking ) . toBe ( undefined ) ;
423
+ } ) ;
424
+ } ) ;
404
425
} ) ;
31C2 0 commit comments