File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 11import { addTracingExtensions , Scope } from '@sentry/svelte' ;
22import { baggageHeaderToDynamicSamplingContext } from '@sentry/utils' ;
3- import * as utils from '@sentry/utils' ;
43import type { Load } from '@sveltejs/kit' ;
54import { redirect } from '@sveltejs/kit' ;
65import { 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 > > {
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export function setup() {
1313}
1414
1515if ( ! 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 ) ;
You can’t perform that action at this time.
0 commit comments