-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sveltekit): Always add browserTracingIntegration (#13322)
- Loading branch information
Showing
2 changed files
with
6 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ describe('Sentry client SDK', () => { | |
['tracesSampleRate', { tracesSampleRate: 0 }], | ||
['tracesSampler', { tracesSampler: () => 1.0 }], | ||
['enableTracing', { enableTracing: true }], | ||
['no tracing option set', {}], | ||
])('adds a browserTracingIntegration if tracing is enabled via %s', (_, tracingOptions) => { | ||
init({ | ||
dsn: 'https://[email protected]/1337', | ||
|
@@ -56,19 +57,6 @@ describe('Sentry client SDK', () => { | |
expect(browserTracing).toBeDefined(); | ||
}); | ||
|
||
it.each([ | ||
['enableTracing', { enableTracing: false }], | ||
['no tracing option set', {}], | ||
])("doesn't add a browserTracingIntegration integration if tracing is disabled via %s", (_, tracingOptions) => { | ||
init({ | ||
dsn: 'https://[email protected]/1337', | ||
...tracingOptions, | ||
}); | ||
|
||
const browserTracing = getClient<BrowserClient>()?.getIntegrationByName('BrowserTracing'); | ||
expect(browserTracing).toBeUndefined(); | ||
}); | ||
|
||
it("doesn't add a browserTracingIntegration if `__SENTRY_TRACING__` is set to false", () => { | ||
// This is the closest we can get to unit-testing the `__SENTRY_TRACING__` tree-shaking guard | ||
// IRL, the code to add the integration would most likely be removed by the bundler. | ||
|