-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy patherrors.test.ts
More file actions
30 lines (25 loc) · 718 Bytes
/
errors.test.ts
File metadata and controls
30 lines (25 loc) · 718 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
29
30
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';
test('sends an error', async ({ page }) => {
const errorPromise = waitForError('svelte-5', async errorEvent => {
return !errorEvent.type;
});
await page.goto(`/`);
await page.locator('#errorBtn').click();
const error = await errorPromise;
expect(error).toMatchObject({
exception: {
values: [
{
type: 'Error',
value: 'Error thrown from Svelte 5 E2E test app',
mechanism: {
type: 'auto.browser.browserapierrors.addEventListener',
handled: false,
},
},
],
},
transaction: '/',
});
});