-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy patherrors.test.ts
More file actions
19 lines (15 loc) · 770 Bytes
/
errors.test.ts
File metadata and controls
19 lines (15 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';
test('should capture errors', async ({ request }) => {
const errorEventPromise = waitForError('node-core-light-express', event => {
return event?.exception?.values?.[0]?.value === 'Test error from light mode';
});
const response = await request.get('/test-error');
expect(response.status()).toBe(500);
const errorEvent = await errorEventPromise;
expect(errorEvent).toBeDefined();
expect(errorEvent.exception?.values?.[0]?.value).toBe('Test error from light mode');
expect(errorEvent.tags?.test).toBe('error');
// Ensure IP address is not leaked when sendDefaultPii is not set
expect(errorEvent.user?.ip_address).toBeUndefined();
});