File tree Expand file tree Collapse file tree 3 files changed +26
-5
lines changed
dev-packages/e2e-tests/test-applications Expand file tree Collapse file tree 3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 22
22
"@sentry-internal/test-utils" : " link:../../../test-utils" ,
23
23
"@sentry/core" : " latest || *" ,
24
24
"@sveltejs/adapter-auto" : " ^3.0.0" ,
25
- "@sveltejs/kit" : " ^2.0 .0" ,
25
+ "@sveltejs/kit" : " 2.5 .0" ,
26
26
"@sveltejs/vite-plugin-svelte" : " ^3.0.0" ,
27
27
"svelte" : " ^5.0.0-next.115" ,
28
28
"svelte-check" : " ^3.6.0" ,
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@playwright/test' ;
2
+
3
+ test . describe ( 'SDK-internal behavior' , ( ) => {
4
+ test ( 'Injects fetch proxy script for SvelteKit<2.16.0' , async ( { page } ) => {
5
+ await page . goto ( '/' ) ;
6
+
7
+ const sentryCarrier = await page . evaluate ( 'typeof window.__SENTRY__' ) ;
8
+ const proxyHandle = await page . evaluate ( 'typeof window._sentryFetchProxy' ) ;
9
+
10
+ // sanity check
11
+ expect ( sentryCarrier ) . toBe ( 'object' ) ;
12
+
13
+ // fetch proxy script ran
14
+ expect ( proxyHandle ) . toBe ( 'function' ) ;
15
+ } ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change @@ -3,9 +3,14 @@ import { waitForInitialPageload } from './utils';
3
3
4
4
test . describe ( 'SDK-internal behavior' , ( ) => {
5
5
test ( "Doesn't inject fetch proxy script for SvelteKit>=2.16.0" , async ( { page } ) => {
6
- await waitForInitialPageload ( page , { route : '/client-error' } ) ;
7
- // @ts -expect-error - this is the variable the fetch proxy script sets if it would be injected
8
- const proxyHandle = await page . waitForFunction ( ( ) => globalThis . _sentryFetchProxy ) ;
9
- expect ( proxyHandle ) . toBeUndefined ( ) ;
6
+ await waitForInitialPageload ( page , { route : '/' } ) ;
7
+ const sentryCarrier = await page . evaluate ( 'typeof window.__SENTRY__' ) ;
8
+ const proxyHandle = await page . evaluate ( 'typeof window._sentryFetchProxy' ) ;
9
+
10
+ // sanity check
11
+ expect ( sentryCarrier ) . toBe ( 'object' ) ;
12
+
13
+ // fetch proxy script didn't run
14
+ expect ( proxyHandle ) . toBe ( 'undefined' ) ;
10
15
} ) ;
11
16
} ) ;
You can’t perform that action at this time.
0 commit comments