Skip to content

Commit 568bc7c

Browse files
committed
linter and cleanup
1 parent 236cb9e commit 568bc7c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

packages/sveltekit/test/client/load.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { addTracingExtensions, Scope } from '@sentry/svelte';
22
import { baggageHeaderToDynamicSamplingContext } from '@sentry/utils';
3-
import * as utils from '@sentry/utils';
43
import type { Load } from '@sveltejs/kit';
54
import { redirect } from '@sveltejs/kit';
65
import { vi } from 'vitest';
@@ -28,9 +27,9 @@ vi.mock('@sentry/svelte', async () => {
2827
};
2928
});
3029

31-
vi.spyOn(utils, 'getDomElement').mockImplementation(() => {
30+
vi.mock('../../src/client/vendor/lookUpCache', () => {
3231
return {
33-
textContent: 'test',
32+
isRequestCached: () => false,
3433
};
3534
});
3635

@@ -440,7 +439,6 @@ describe('wrapLoadWithSentry', () => {
440439
['is undefined', undefined],
441440
["doesn't have a `getClientById` method", {}],
442441
])("doesn't instrument fetch if the client %s", async (_, client) => {
443-
// @ts-expect-error: we're mocking the client
444442
mockedGetClient.mockImplementationOnce(() => client);
445443

446444
async function load(_event: Parameters<Load>[0]): Promise<ReturnType<Load>> {

packages/sveltekit/test/vitest.setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export function setup() {
1313
}
1414

1515
if (!globalThis.fetch) {
16-
// @ts-ignore dfsf
16+
// @ts-ignore - Needed for vitest to work with SvelteKit fetch instrumentation
1717
globalThis.Request = class Request {};
1818
}
19-
console.log(globalThis.fetch, globalThis.Response, globalThis.Request);

0 commit comments

Comments
 (0)