diff --git a/packages/sveltekit/test/client/load.test.ts b/packages/sveltekit/test/client/load.test.ts index 0b74b78cefc6..07608bb9845a 100644 --- a/packages/sveltekit/test/client/load.test.ts +++ b/packages/sveltekit/test/client/load.test.ts @@ -1,6 +1,5 @@ import { addTracingExtensions, Scope } from '@sentry/svelte'; import { baggageHeaderToDynamicSamplingContext } from '@sentry/utils'; -import * as utils from '@sentry/utils'; import type { Load } from '@sveltejs/kit'; import { redirect } from '@sveltejs/kit'; import { vi } from 'vitest'; @@ -28,9 +27,9 @@ vi.mock('@sentry/svelte', async () => { }; }); -vi.spyOn(utils, 'getDomElement').mockImplementation(() => { +vi.mock('../../src/client/vendor/lookUpCache', () => { return { - textContent: 'test', + isRequestCached: () => false, }; }); @@ -440,7 +439,6 @@ describe('wrapLoadWithSentry', () => { ['is undefined', undefined], ["doesn't have a `getClientById` method", {}], ])("doesn't instrument fetch if the client %s", async (_, client) => { - // @ts-expect-error: we're mocking the client mockedGetClient.mockImplementationOnce(() => client); async function load(_event: Parameters[0]): Promise> { diff --git a/packages/sveltekit/test/vitest.setup.ts b/packages/sveltekit/test/vitest.setup.ts index cafd02a8ab51..af2810a98a96 100644 --- a/packages/sveltekit/test/vitest.setup.ts +++ b/packages/sveltekit/test/vitest.setup.ts @@ -13,7 +13,6 @@ export function setup() { } if (!globalThis.fetch) { - // @ts-ignore dfsf + // @ts-ignore - Needed for vitest to work with SvelteKit fetch instrumentation globalThis.Request = class Request {}; } -console.log(globalThis.fetch, globalThis.Response, globalThis.Request);