-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
43 lines (39 loc) · 1.68 KB
/
test.ts
File metadata and controls
43 lines (39 loc) · 1.68 KB
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
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
sentryTest('should capture a linked error with messages', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
expect(eventData.exception?.values).toHaveLength(2);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'Error',
value: `This is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be`,
mechanism: {
type: 'chained',
handled: true,
},
stacktrace: {
frames: expect.any(Array),
},
});
expect(eventData.exception?.values?.[1]).toMatchObject({
type: 'Error',
value: `This is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be`,
mechanism: {
type: 'generic',
handled: true,
},
stacktrace: {
frames: expect.any(Array),
},
});
});