Skip to content

Commit 3f084ac

Browse files
authored
test(loader): Use new min. loader (#7772)
1 parent 4395d74 commit 3f084ac

File tree

6 files changed

+26
-246
lines changed

6 files changed

+26
-246
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.md
22
.nxcache
3+
packages/browser-integration-tests/fixtures

packages/browser-integration-tests/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
'loader-suites/**/dist/*',
1111
'loader-suites/**/subject.js',
1212
'scripts/**',
13+
'fixtures/**',
1314
],
1415
parserOptions: {
1516
sourceType: 'module',

packages/browser-integration-tests/fixtures/loader.js

Lines changed: 1 addition & 246 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.onLoad(function () {
6+
Sentry.captureException('Test exception');
7+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sentry.forceLoad();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
5+
6+
sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl, page }) => {
7+
const req = waitForErrorRequest(page);
8+
9+
const url = await getLocalTestUrl({ testDir: __dirname });
10+
await page.goto(url);
11+
12+
const eventData = envelopeRequestParser(await req);
13+
14+
expect(eventData.message).toBe('Test exception');
15+
});

0 commit comments

Comments
 (0)