Skip to content

Commit f464cac

Browse files
committed
Use @embroider/macros instead of Ember.testing for @sentry/ember
1 parent dba35c8 commit f464cac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/ember/addon/instance-initializers/sentry-performance.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import { Span, Transaction, Integration } from '@sentry/types';
77
import { EmberRunQueues } from '@ember/runloop/-private/types';
88
import { getActiveTransaction } from '..';
99
import { timestampWithMs } from '@sentry/utils';
10+
import { macroCondition, isTesting } from '@embroider/macros';
1011

1112
export function initialize(appInstance: ApplicationInstance): void {
1213
const config = environmentConfig['@sentry/ember'];
1314
if (config['disablePerformance']) {
1415
return;
1516
}
1617
const performancePromise = instrumentForPerformance(appInstance);
17-
if (Ember.testing) {
18+
if (macroCondition(isTesting())) {
1819
(<any>window)._sentryPerformanceLoad = performancePromise;
1920
}
2021
}
@@ -42,7 +43,7 @@ export function _instrumentEmberRouter(
4243

4344
const url = location && location.getURL && location.getURL();
4445

45-
if (Ember.testing) {
46+
if (macroCondition(isTesting())) {
4647
routerService._sentryInstrumented = true;
4748
routerService._startTransaction = startTransaction;
4849
}
@@ -329,7 +330,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
329330
}),
330331
];
331332

332-
if (Ember.testing && Sentry.getCurrentHub()?.getIntegration(tracing.Integrations.BrowserTracing)) {
333+
if (isTesting() && Sentry.getCurrentHub()?.getIntegration(tracing.Integrations.BrowserTracing)) {
333334
// Initializers are called more than once in tests, causing the integrations to not be setup correctly.
334335
return;
335336
}

0 commit comments

Comments
 (0)