diff --git a/dev-packages/e2e-tests/test-applications/solidstart/src/routes/client-error.tsx b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/client-error.tsx index baf18d61de79..5e405e8c4e40 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/src/routes/client-error.tsx +++ b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/client-error.tsx @@ -1,75 +1,15 @@ -import * as Sentry from '@sentry/solidstart'; -import type { ParentProps } from 'solid-js'; -import { ErrorBoundary, createSignal, onMount } from 'solid-js'; - -const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary); - -const [count, setCount] = createSignal(1); -const [caughtError, setCaughtError] = createSignal(false); - export default function ClientErrorPage() { return ( - - {caughtError() && ( - - )} -
-
- -
-
- -
-
-
- ); -} - -function Throw(props: { error: string }) { - onMount(() => { - throw new Error(props.error); - }); - return null; -} - -function SampleErrorBoundary(props: ParentProps) { - return ( - ( -
-

Error Boundary Fallback

-
- {error.message} -
- -
- )} - > - {props.children} -
+
+ +
); } diff --git a/dev-packages/e2e-tests/test-applications/solidstart/src/routes/error-boundary.tsx b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/error-boundary.tsx new file mode 100644 index 000000000000..b22607667e7e --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/error-boundary.tsx @@ -0,0 +1,64 @@ +import * as Sentry from '@sentry/solidstart'; +import type { ParentProps } from 'solid-js'; +import { ErrorBoundary, createSignal, onMount } from 'solid-js'; + +const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary); + +const [count, setCount] = createSignal(1); +const [caughtError, setCaughtError] = createSignal(false); + +export default function ErrorBoundaryTestPage() { + return ( + + {caughtError() && ( + + )} +
+
+ +
+
+
+ ); +} + +function Throw(props: { error: string }) { + onMount(() => { + throw new Error(props.error); + }); + return null; +} + +function SampleErrorBoundary(props: ParentProps) { + return ( + ( +
+

Error Boundary Fallback

+
+ {error.message} +
+ +
+ )} + > + {props.children} +
+ ); +} diff --git a/dev-packages/e2e-tests/test-applications/solidstart/src/routes/index.tsx b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/index.tsx index eed722cba4e3..9a0b22cc38c6 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/src/routes/index.tsx +++ b/dev-packages/e2e-tests/test-applications/solidstart/src/routes/index.tsx @@ -14,6 +14,9 @@ export default function Home() {
  • Server error
  • +
  • + Error Boundary +
  • User 5 diff --git a/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts index fb69118a9899..b709760aab94 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts @@ -1,7 +1,7 @@ import { expect, test } from '@playwright/test'; import { waitForError } from '@sentry-internal/test-utils'; -test.skip('captures an exception', async ({ page }) => { +test('captures an exception', async ({ page }) => { const errorEventPromise = waitForError('solidstart', errorEvent => { return ( !errorEvent.type && @@ -10,7 +10,7 @@ test.skip('captures an exception', async ({ page }) => { ); }); - await page.goto('/client-error'); + await page.goto('/error-boundary'); await page.locator('#caughtErrorBtn').click(); const errorEvent = await errorEventPromise; @@ -27,11 +27,11 @@ test.skip('captures an exception', async ({ page }) => { }, ], }, - transaction: '/client-error', + transaction: '/error-boundary', }); }); -test.skip('captures a second exception after resetting the boundary', async ({ page }) => { +test('captures a second exception after resetting the boundary', async ({ page }) => { const firstErrorEventPromise = waitForError('solidstart', errorEvent => { return ( !errorEvent.type && @@ -40,7 +40,7 @@ test.skip('captures a second exception after resetting the boundary', async ({ p ); }); - await page.goto('/client-error'); + await page.goto('/error-boundary'); await page.locator('#caughtErrorBtn').click(); const firstErrorEvent = await firstErrorEventPromise; @@ -57,7 +57,7 @@ test.skip('captures a second exception after resetting the boundary', async ({ p }, ], }, - transaction: '/client-error', + transaction: '/error-boundary', }); const secondErrorEventPromise = waitForError('solidstart', errorEvent => { @@ -85,6 +85,6 @@ test.skip('captures a second exception after resetting the boundary', async ({ p }, ], }, - transaction: '/client-error', + transaction: '/error-boundary', }); }); diff --git a/dev-packages/e2e-tests/test-applications/solidstart/tests/errors.client.test.ts b/dev-packages/e2e-tests/test-applications/solidstart/tests/errors.client.test.ts index 48ffbefc025e..0eee4aba25ee 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/tests/errors.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/tests/errors.client.test.ts @@ -18,7 +18,7 @@ test.describe('client-side errors', () => { type: 'Error', value: 'Uncaught error thrown from Solid Start E2E test app', mechanism: { - type: 'instrument', + type: 'onerror', handled: false, }, },