Skip to content

Commit fec77bc

Browse files
author
Luca Forstner
committed
.
1 parent cd323cd commit fec77bc

File tree

1 file changed

+2
-60
lines changed

1 file changed

+2
-60
lines changed

packages/tracing-internal/test/browser/browsertracing.test.ts

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ import * as hubExtensions from '@sentry/core';
1010
import type { BaseTransportOptions, ClientOptions, DsnComponents, HandlerDataHistory } from '@sentry/types';
1111
import { JSDOM } from 'jsdom';
1212

13-
import { BrowserClient } from '@sentry/browser';
13+
import { browserTracingIntegration } from '@sentry/browser';
1414
import { timestampInSeconds } from '@sentry/utils';
1515
import type { IdleTransaction } from '../../../tracing/src';
1616
import { getActiveTransaction } from '../../../tracing/src';
1717
import { getDefaultBrowserClientOptions } from '../../../tracing/test/testutils';
18-
import { browserTracingIntegration } from '../../build/types';
1918
import type { BrowserTracingOptions } from '../../src/browser/browsertracing';
2019
import { getMetaContent } from '../../src/browser/browsertracing';
21-
import { defaultRequestInstrumentationOptions } from '../../src/browser/request';
22-
import { instrumentRoutingWithDefaults } from '../../src/browser/router';
2320
import { WINDOW } from '../../src/browser/types';
2421
import { TestClient } from '../utils/TestClient';
2522

@@ -86,67 +83,12 @@ describe('BrowserTracing', () => {
8683
function createBrowserTracing(setup?: boolean, options?: Partial<BrowserTracingOptions>) {
8784
const instance = browserTracingIntegration(options);
8885
if (setup) {
89-
instance.afterAllSetup(new BrowserClient());
86+
instance.afterAllSetup(new TestClient(getDefaultBrowserClientOptions()));
9087
}
9188

9289
return instance;
9390
}
9491

95-
// These are important enough to check with a test as incorrect defaults could
96-
// break a lot of users' configurations.
97-
it('is created with default settings', () => {
98-
const browserTracing = createBrowserTracing();
99-
100-
expect(browserTracing.options).toEqual({
101-
enableLongTask: true,
102-
_experiments: {},
103-
...TRACING_DEFAULTS,
104-
markBackgroundTransactions: true,
105-
routingInstrumentation: instrumentRoutingWithDefaults,
106-
startTransactionOnLocationChange: true,
107-
startTransactionOnPageLoad: true,
108-
...defaultRequestInstrumentationOptions,
109-
});
110-
});
111-
112-
it('is allows to disable enableLongTask via _experiments', () => {
113-
const browserTracing = createBrowserTracing(false, {
114-
_experiments: {
115-
enableLongTask: false,
116-
},
117-
});
118-
119-
expect(browserTracing.options).toEqual({
120-
enableLongTask: false,
121-
...TRACING_DEFAULTS,
122-
markBackgroundTransactions: true,
123-
routingInstrumentation: instrumentRoutingWithDefaults,
124-
startTransactionOnLocationChange: true,
125-
startTransactionOnPageLoad: true,
126-
...defaultRequestInstrumentationOptions,
127-
_experiments: {
128-
enableLongTask: false,
129-
},
130-
});
131-
});
132-
133-
it('is allows to disable enableLongTask', () => {
134-
const browserTracing = createBrowserTracing(false, {
135-
enableLongTask: false,
136-
});
137-
138-
expect(browserTracing.options).toEqual({
139-
enableLongTask: false,
140-
_experiments: {},
141-
...TRACING_DEFAULTS,
142-
markBackgroundTransactions: true,
143-
routingInstrumentation: instrumentRoutingWithDefaults,
144-
startTransactionOnLocationChange: true,
145-
startTransactionOnPageLoad: true,
146-
...defaultRequestInstrumentationOptions,
147-
});
148-
});
149-
15092
/**
15193
* All of these tests under `describe('route transaction')` are tested with
15294
* `browserTracing.options = { routingInstrumentation: customInstrumentRouting }`,

0 commit comments

Comments
 (0)