Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dev-packages/e2e-tests/test-applications/webpack-4/entry.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { browserTracingIntegration, captureException, init } from '@sentry/browser';
import { browserTracingIntegration, init } from '@sentry/browser';

init({
dsn: process.env.E2E_TEST_DSN,
integrations: [browserTracingIntegration()],
tunnel: 'http://localhost:3031',
});

setTimeout(() => {
const eventId = captureException(new Error('I am an error!'));
window.capturedExceptionId = eventId;
throw new Error('I am an error!');
}, 2000);
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"devDependencies": {
"@playwright/test": "^1.44.1",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/browser": "latest || *",
"webpack": "^4.47.0",
"terser-webpack-plugin": "^4.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getPlaywrightConfig } from '@sentry-internal/test-utils';

const config = getPlaywrightConfig({
startCommand: 'pnpm start',
});

export default config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { startEventProxyServer } from '@sentry-internal/test-utils';

startEventProxyServer({
port: 3031,
proxyServerName: 'webpack-4',
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';

test('Captures an exception', async ({ page }) => {
const eventPromise = waitForError('webpack-4', event => {
return event.exception?.values?.[0].value === 'I am an error!';
});
await page.goto('/');

const errorEvent = await eventPromise;

expect(errorEvent.exception?.values?.[0].value).toBe('I am an error!');
expect(errorEvent.transaction).toBe('/');
});
6 changes: 3 additions & 3 deletions dev-packages/e2e-tests/test-applications/webpack-5/entry.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { browserTracingIntegration, captureException, init } from '@sentry/browser';
import { browserTracingIntegration, init } from '@sentry/browser';

init({
dsn: process.env.E2E_TEST_DSN,
integrations: [browserTracingIntegration()],
tunnel: 'http://localhost:3031',
});

setTimeout(() => {
const eventId = captureException(new Error('I am an error!'));
window.capturedExceptionId = eventId;
throw new Error('I am an error!');
}, 2000);
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"devDependencies": {
"@playwright/test": "^1.44.1",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/browser": "latest || *",
"webpack": "^5.91.0",
"terser-webpack-plugin": "^5.3.10",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getPlaywrightConfig } from '@sentry-internal/test-utils';

const config = getPlaywrightConfig({
startCommand: 'pnpm start',
});

export default config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { startEventProxyServer } from '@sentry-internal/test-utils';

startEventProxyServer({
port: 3031,
proxyServerName: 'webpack-5',
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';

test('Captures an exception', async ({ page }) => {
const eventPromise = waitForError('webpack-5', event => {
return event.exception?.values?.[0].value === 'I am an error!';
});
await page.goto('/');

const errorEvent = await eventPromise;

expect(errorEvent.exception?.values?.[0].value).toBe('I am an error!');
expect(errorEvent.transaction).toBe('/');
});