Skip to content

Commit

Permalink
linter and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Jun 23, 2023
1 parent 236cb9e commit 568bc7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/sveltekit/test/client/load.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
});

Expand Down Expand Up @@ -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<Load>[0]): Promise<ReturnType<Load>> {
Expand Down
3 changes: 1 addition & 2 deletions packages/sveltekit/test/vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 568bc7c

Please sign in to comment.