Skip to content

Commit 1886c87

Browse files
committed
cleanup
1 parent 22124e0 commit 1886c87

File tree

7 files changed

+4
-26
lines changed

7 files changed

+4
-26
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# SvelteKit 2 TwP
1+
# Tracing Without Performance E2E test app
22

33
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.

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/src/hooks.client.ts

-4
Original file line numberDiff line numberDiff 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

1713
const myErrorHandler = ({ error, event }: any) => {

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/src/hooks.server.ts

-4
Original file line numberDiff line numberDiff 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

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/src/routes/+layout.svelte

-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
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>

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/src/routes/errors/+page.server.ts

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import * as Sentry from '@sentry/sveltekit';
22

33
export 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',

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/src/routes/errors/+page.svelte

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
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
});

dev-packages/e2e-tests/test-applications/sveltekit-2-twp/tests/errors.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForError } from '@sentry-internal/test-utils';
3+
34
test('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';

0 commit comments

Comments
 (0)