File tree 7 files changed +4
-26
lines changed
dev-packages/e2e-tests/test-applications/sveltekit-2-twp
7 files changed +4
-26
lines changed Original file line number Diff line number Diff line change 1
- # SvelteKit 2 TwP
1
+ # Tracing Without Performance E2E test app
2
2
3
3
E2E test app for testing Tracing Without Performance in a (SvelteKit) meta framework scenario
4
+
5
+ Add tests to this app that specifically test TwP in meta frameworks.
Original file line number Diff line number Diff line change @@ -8,10 +8,6 @@ Sentry.init({
8
8
dsn : env . PUBLIC_E2E_TEST_DSN ,
9
9
release : '1.0.0' ,
10
10
tunnel : `http://localhost:3031/` , // proxy server
11
- beforeSend ( event ) {
12
- console . log ( 'beforeSend' , event . contexts ?. trace ?. trace_id ) ;
13
- return event ;
14
- } ,
15
11
} ) ;
16
12
17
13
const myErrorHandler = ( { error, event } : any ) => {
Original file line number Diff line number Diff line change @@ -5,10 +5,6 @@ Sentry.init({
5
5
environment : 'qa' , // dynamic sampling bias to keep transactions
6
6
dsn : E2E_TEST_DSN ,
7
7
tunnel : `http://localhost:3031/` , // proxy server
8
- beforeSend ( event ) {
9
- console . log ( 'beforeSend' , event . contexts ?. trace ?. trace_id ) ;
10
- return event ;
11
- } ,
12
8
} ) ;
13
9
14
10
// not logging anything to console to avoid noise in the test output
Original file line number Diff line number Diff line change 1
- <script lang =" ts" >
2
- import { onMount } from " svelte" ;
3
-
4
- onMount (() => {
5
- // Indicate that the SvelteKit app was hydrated
6
- document .body .classList .add (" hydrated" );
7
- });
8
-
9
-
10
- </script >
11
-
12
1
<h1 >Sveltekit E2E Test app</h1 >
13
2
<div data-sveltekit-preload-data =" off" >
14
3
<slot ></slot >
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ import * as Sentry from '@sentry/sveltekit';
2
2
3
3
export const load = async ( { url } ) => {
4
4
if ( ! url . search ) {
5
- console . log ( 'traceData: ' , Sentry . getTraceData ( ) ) ;
6
- console . log ( 'spanToTrace' , Sentry . spanToTraceHeader ( Sentry . getActiveSpan ( ) ! ) ) ;
7
- console . log ( 'activeSpan' , Sentry . getActiveSpan ( ) ) ;
8
5
Sentry . captureException ( new Error ( 'No search query provided' ) ) ;
9
6
return {
10
7
error : 'No search query provided' ,
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { onMount } from ' svelte' ;
3
- import * as Sentry from ' @sentry/sveltekit' ;
4
3
5
4
export let data;
6
5
7
6
onMount (() => {
8
-
9
7
if (data .error ) {
10
- console .log (Sentry .getTraceData ());
11
8
throw new Error (' Client Error' );
12
9
}
13
10
});
Original file line number Diff line number Diff line change 1
1
import { expect , test } from '@playwright/test' ;
2
2
import { waitForError } from '@sentry-internal/test-utils' ;
3
+
3
4
test ( 'errors on frontend and backend are connected by the same trace' , async ( { page } ) => {
4
5
const clientErrorPromise = waitForError ( 'sveltekit-2-twp' , evt => {
5
6
return evt . exception ?. values ?. [ 0 ] . value === 'Client Error' ;
You can’t perform that action at this time.
0 commit comments