From 2c4ff4d8c0836dc70842c42d54c18731584c98e5 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Tue, 23 Jul 2024 10:59:26 +0200 Subject: [PATCH] fix tests --- packages/nuxt/test/client/sdk.test.ts | 33 +-------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/packages/nuxt/test/client/sdk.test.ts b/packages/nuxt/test/client/sdk.test.ts index 0c9a7ff28896..83182bfc1c19 100644 --- a/packages/nuxt/test/client/sdk.test.ts +++ b/packages/nuxt/test/client/sdk.test.ts @@ -40,6 +40,7 @@ describe('Nuxt Client SDK', () => { ['tracesSampleRate', { tracesSampleRate: 0 }], ['tracesSampler', { tracesSampler: () => 1.0 }], ['enableTracing', { enableTracing: true }], + ['no tracing option set', {}] /* enable "tracing without performance" by default */, ])('adds a browserTracingIntegration if tracing is enabled via %s', (_, tracingOptions) => { init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', @@ -49,38 +50,6 @@ describe('Nuxt Client SDK', () => { const browserTracing = getClient()?.getIntegrationByName('BrowserTracing'); 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://public@dsn.ingest.sentry.io/1337', - ...tracingOptions, - }); - - const browserTracing = getClient()?.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. - - // @ts-expect-error: Testing purposes - globalThis.__SENTRY_TRACING__ = false; - - init({ - dsn: 'https://public@dsn.ingest.sentry.io/1337', - tracesSampleRate: 0.3, - }); - - const browserTracing = getClient()?.getIntegrationByName('BrowserTracing'); - expect(browserTracing).toBeUndefined(); - - // @ts-expect-error: Testing purposes - delete globalThis.__SENTRY_TRACING__; - }); }); it('returns client from init', () => {