@@ -377,7 +377,7 @@ describe('SentryNode initialization', () => {
377377 defaultIntegrations : [ new MockIntegration ( 'bar' ) ] ,
378378 } ) ;
379379 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' ] ) ;
381381 } ) ;
382382 } ) ;
383383
@@ -387,7 +387,7 @@ describe('SentryNode initialization', () => {
387387 defaultIntegrations : [ new MockIntegration ( 'baz' ) , new MockIntegration ( 'qux' ) ] ,
388388 } ) ;
389389 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' ] ) ;
391391 } ) ;
392392 } ) ;
393393
@@ -401,4 +401,25 @@ describe('SentryNode initialization', () => {
401401 } ) ;
402402 } ) ;
403403 } ) ;
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+ } ) ;
404425} ) ;
0 commit comments