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 1
1
import { addTracingExtensions , Scope } from '@sentry/svelte' ;
2
2
import { baggageHeaderToDynamicSamplingContext } from '@sentry/utils' ;
3
- import * as utils from '@sentry/utils' ;
4
3
import type { Load } from '@sveltejs/kit' ;
5
4
import { redirect } from '@sveltejs/kit' ;
6
5
import { vi } from 'vitest' ;
@@ -28,9 +27,9 @@ vi.mock('@sentry/svelte', async () => {
28
27
} ;
29
28
} ) ;
30
29
31
- vi . spyOn ( utils , 'getDomElement' ) . mockImplementation ( ( ) => {
30
+ vi . mock ( '../../src/client/vendor/lookUpCache' , ( ) => {
32
31
return {
33
- textContent : 'test' ,
32
+ isRequestCached : ( ) => false ,
34
33
} ;
35
34
} ) ;
36
35
@@ -440,7 +439,6 @@ describe('wrapLoadWithSentry', () => {
440
439
[ 'is undefined' , undefined ] ,
441
440
[ "doesn't have a `getClientById` method" , { } ] ,
442
441
] ) ( "doesn't instrument fetch if the client %s" , async ( _ , client ) => {
443
- // @ts -expect-error: we're mocking the client
444
442
mockedGetClient . mockImplementationOnce ( ( ) => client ) ;
445
443
446
444
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() {
13
13
}
14
14
15
15
if ( ! globalThis . fetch ) {
16
- // @ts -ignore dfsf
16
+ // @ts -ignore - Needed for vitest to work with SvelteKit fetch instrumentation
17
17
globalThis . Request = class Request { } ;
18
18
}
19
- console . log ( globalThis . fetch , globalThis . Response , globalThis . Request ) ;
You can’t perform that action at this time.
0 commit comments