File tree Expand file tree Collapse file tree 7 files changed +4
-26
lines changed
dev-packages/e2e-tests/test-applications/sveltekit-2-twp Expand file tree Collapse file tree 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
22
33E2E 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({
88 dsn : env . PUBLIC_E2E_TEST_DSN ,
99 release : '1.0.0' ,
1010 tunnel : `http://localhost:3031/` , // proxy server
11- beforeSend ( event ) {
12- console . log ( 'beforeSend' , event . contexts ?. trace ?. trace_id ) ;
13- return event ;
14- } ,
1511} ) ;
1612
1713const myErrorHandler = ( { error, event } : any ) => {
Original file line number Diff line number Diff line change @@ -5,10 +5,6 @@ Sentry.init({
55 environment : 'qa' , // dynamic sampling bias to keep transactions
66 dsn : E2E_TEST_DSN ,
77 tunnel : `http://localhost:3031/` , // proxy server
8- beforeSend ( event ) {
9- console . log ( 'beforeSend' , event . contexts ?. trace ?. trace_id ) ;
10- return event ;
11- } ,
128} ) ;
139
1410// 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-
121<h1 >Sveltekit E2E Test app</h1 >
132<div data-sveltekit-preload-data =" off" >
143 <slot ></slot >
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ import * as Sentry from '@sentry/sveltekit';
22
33export const load = async ( { url } ) => {
44 if ( ! url . search ) {
5- console . log ( 'traceData: ' , Sentry . getTraceData ( ) ) ;
6- console . log ( 'spanToTrace' , Sentry . spanToTraceHeader ( Sentry . getActiveSpan ( ) ! ) ) ;
7- console . log ( 'activeSpan' , Sentry . getActiveSpan ( ) ) ;
85 Sentry . captureException ( new Error ( 'No search query provided' ) ) ;
96 return {
107 error : 'No search query provided' ,
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { onMount } from ' svelte' ;
3- import * as Sentry from ' @sentry/sveltekit' ;
43
54 export let data;
65
76 onMount (() => {
8-
97 if (data .error ) {
10- console .log (Sentry .getTraceData ());
118 throw new Error (' Client Error' );
129 }
1310 });
Original file line number Diff line number Diff line change 11import { expect , test } from '@playwright/test' ;
22import { waitForError } from '@sentry-internal/test-utils' ;
3+
34test ( 'errors on frontend and backend are connected by the same trace' , async ( { page } ) => {
45 const clientErrorPromise = waitForError ( 'sveltekit-2-twp' , evt => {
56 return evt . exception ?. values ?. [ 0 ] . value === 'Client Error' ;
You can’t perform that action at this time.
0 commit comments