@@ -10,6 +10,7 @@ import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampWithMs } from '@sent
10
10
import { macroCondition , isTesting , getOwnConfig } from '@embroider/macros' ;
11
11
import { EmberSentryConfig , GlobalConfig , OwnConfig } from '../types' ;
12
12
import RouterService from '@ember/routing/router-service' ;
13
+ import { BaseClient } from '@sentry/core' ;
13
14
14
15
function getSentryConfig ( ) {
15
16
const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig ;
@@ -416,20 +417,12 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
416
417
} ) ;
417
418
418
419
if ( macroCondition ( isTesting ( ) ) ) {
419
- class FakeBrowserTracingClass {
420
- static id = 'BrowserTracing' ;
421
- public name = FakeBrowserTracingClass . id ;
422
- setupOnce ( ) {
423
- // noop - We're just faking this class for a lookup
424
- }
425
- }
420
+ const client = Sentry . getCurrentHub ( ) . getClient ( ) ;
426
421
427
422
if (
428
- Sentry . getCurrentHub ( ) ?. getIntegration (
429
- // This is a temporary hack because the BrowserTracing integration cannot have a static `id` field for tree
430
- // shaking reasons. However, `getIntegration` needs that field.
431
- FakeBrowserTracingClass ,
432
- )
423
+ client &&
424
+ ( client as BaseClient < any > ) . getIntegrationById &&
425
+ ( client as BaseClient < any > ) . getIntegrationById ( 'BrowserTracing' )
433
426
) {
434
427
// Initializers are called more than once in tests, causing the integrations to not be setup correctly.
435
428
return ;
0 commit comments