-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy patherrors.test.ts
More file actions
28 lines (24 loc) · 795 Bytes
/
errors.test.ts
File metadata and controls
28 lines (24 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';
test('sends an error', async ({ page }) => {
const errorPromise = waitForError('solid', async errorEvent => {
return !errorEvent.type && errorEvent.exception?.values?.[0]?.value === 'Error thrown from Solid E2E test app';
});
await Promise.all([page.goto(`/`), page.locator('#errorBtn').click()]);
const error = await errorPromise;
expect(error).toMatchObject({
exception: {
values: [
{
type: 'Error',
value: 'Error thrown from Solid E2E test app',
mechanism: {
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
},
],
},
transaction: '/',
});
});