-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy patherrors.test.ts
58 lines (48 loc) · 1.25 KB
/
errors.test.ts
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';
test('sends an error', async ({ page }) => {
const errorPromise = waitForError('vue-3', 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: 'This is a Vue test error',
mechanism: {
type: 'vue',
handled: false,
},
},
],
},
transaction: '/',
});
});
test('sends an error with a parameterized transaction name', async ({ page }) => {
const errorPromise = waitForError('vue-3', async errorEvent => {
return !errorEvent.type;
});
await page.goto(`/users-error/456`);
await page.locator('#userErrorBtn').click();
const error = await errorPromise;
expect(error).toMatchObject({
exception: {
values: [
{
type: 'Error',
value: 'This is a Vue test error',
mechanism: {
type: 'vue',
handled: false,
},
},
],
},
transaction: '/users-error/:id',
});
});