@@ -40,6 +40,7 @@ describe('SentryBrowser', () => {
40
40
beforeSend,
41
41
dsn,
42
42
transport : makeSimpleTransport ,
43
+ autoSessionTracking : false ,
43
44
} ) ;
44
45
} ) ;
45
46
@@ -218,20 +219,20 @@ describe('SentryBrowser', () => {
218
219
describe ( 'SentryBrowser initialization' , ( ) => {
219
220
it ( 'should use window.SENTRY_RELEASE to set release on initialization if available' , ( ) => {
220
221
global . SENTRY_RELEASE = { id : 'foobar' } ;
221
- init ( { dsn } ) ;
222
+ init ( { dsn, autoSessionTracking : false } ) ;
222
223
expect ( global . __SENTRY__ . hub . _stack [ 0 ] . client . getOptions ( ) . release ) . toBe ( 'foobar' ) ;
223
224
delete global . SENTRY_RELEASE ;
224
225
} ) ;
225
226
226
227
it ( 'should use initialScope' , ( ) => {
227
- init ( { dsn, initialScope : { tags : { a : 'b' } } } ) ;
228
+ init ( { dsn, initialScope : { tags : { a : 'b' } } , autoSessionTracking : false } ) ;
228
229
expect ( global . __SENTRY__ . hub . _stack [ 0 ] . scope . _tags ) . toEqual ( { a : 'b' } ) ;
229
230
} ) ;
230
231
231
232
it ( 'should use initialScope Scope' , ( ) => {
232
233
const scope = new Scope ( ) ;
233
234
scope . setTags ( { a : 'b' } ) ;
234
- init ( { dsn, initialScope : scope } ) ;
235
+ init ( { dsn, initialScope : scope , autoSessionTracking : false } ) ;
235
236
expect ( global . __SENTRY__ . hub . _stack [ 0 ] . scope . _tags ) . toEqual ( { a : 'b' } ) ;
236
237
} ) ;
237
238
@@ -242,19 +243,20 @@ describe('SentryBrowser initialization', () => {
242
243
scope . setTags ( { a : 'b' } ) ;
243
244
return scope ;
244
245
} ,
246
+ autoSessionTracking : false ,
245
247
} ) ;
246
248
expect ( global . __SENTRY__ . hub . _stack [ 0 ] . scope . _tags ) . toEqual ( { a : 'b' } ) ;
247
249
} ) ;
248
250
249
251
it ( 'should have initialization proceed as normal if window.SENTRY_RELEASE is not set' , ( ) => {
250
252
// This is mostly a happy-path test to ensure that the initialization doesn't throw an error.
251
- init ( { dsn } ) ;
253
+ init ( { dsn, autoSessionTracking : false } ) ;
252
254
expect ( global . __SENTRY__ . hub . _stack [ 0 ] . client . getOptions ( ) . release ) . toBeUndefined ( ) ;
253
255
} ) ;
254
256
255
257
describe ( 'SDK metadata' , ( ) => {
256
258
it ( 'should set SDK data when Sentry.init() is called' , ( ) => {
257
- init ( { dsn } ) ;
259
+ init ( { dsn, autoSessionTracking : false } ) ;
258
260
259
261
const sdkData = ( getCurrentHub ( ) . getClient ( ) as any ) . getOptions ( ) . _metadata . sdk ;
260
262
@@ -265,7 +267,7 @@ describe('SentryBrowser initialization', () => {
265
267
} ) ;
266
268
267
269
it ( 'should set SDK data when instantiating a client directly' , ( ) => {
268
- const options = getDefaultBrowserClientOptions ( { dsn } ) ;
270
+ const options = getDefaultBrowserClientOptions ( { dsn, autoSessionTracking : false } ) ;
269
271
const client = new BrowserClient ( options ) ;
270
272
271
273
const sdkData = client . getOptions ( ) . _metadata ?. sdk as any ;
@@ -281,6 +283,7 @@ describe('SentryBrowser initialization', () => {
281
283
it ( "shouldn't overwrite SDK data that's already there" , ( ) => {
282
284
init ( {
283
285
dsn,
286
+ autoSessionTracking : false ,
284
287
// this would normally be set by the wrapper SDK in init()
285
288
_metadata : {
286
289
sdk : {
0 commit comments