Skip to content

Commit 5bf6015

Browse files
committed
test(browser): Remove unused webpack build tests
1 parent d70182e commit 5bf6015

File tree

5 files changed

+66
-1229
lines changed

5 files changed

+66
-1229
lines changed

packages/browser/test/package/test-code.js renamed to dev-packages/browser-integration-tests/suites/public-api/init/built-pkg/subject.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
/* eslint-disable no-console */
2-
const Sentry = require('../../build/npm/cjs/index.js');
3-
4-
// Init
5-
Sentry.init({
6-
dsn: 'https://completelyrandom@dsn.asdf/42',
7-
beforeSend(_event) {
8-
console.log('Got an event');
9-
return null;
10-
},
11-
beforeBreadcrumb(crumb) {
12-
console.log(`Got a breadcrumb: ${crumb.category}`);
13-
return crumb;
14-
},
15-
});
16-
17-
// Configure
181
const scope = Sentry.getCurrentScope();
192
scope.setExtra('foo', 'bar');
203
scope.setFingerprint('foo');
@@ -75,6 +58,6 @@ Sentry.withScope(scope => {
7558

7659
var xhr = new XMLHttpRequest();
7760
xhr.onload = () => console.log('loaded'); // This throws error
78-
// xhr.addEventListener("load", () => console.log('loaded')); This does not throw error
61+
xhr.addEventListener('load', () => console.log('loaded')); // This does not throw error
7962
xhr.open('GET', 'https://httpbin.org/get');
8063
xhr.send();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as fs from 'node:fs';
2+
import * as path from 'node:path';
3+
4+
import { expect } from '@playwright/test';
5+
6+
import { sentryTest } from '../../../../utils/fixtures';
7+
8+
// Regression test against https://github.com/getsentry/sentry-javascript/pull/1896
9+
sentryTest('should not contain tslib_1__default', async ({ getLocalTestPath }) => {
10+
await getLocalTestPath({ testDir: __dirname });
11+
12+
const initBundle = fs.readFileSync(path.join(__dirname, 'dist', 'init.bundle.js'), 'utf-8');
13+
expect(initBundle.length).toBeGreaterThan(0);
14+
expect(initBundle).not.toContain('tslib_1__default');
15+
16+
const subjectBundle = fs.readFileSync(path.join(__dirname, 'dist', 'subject.bundle.js'), 'utf-8');
17+
expect(subjectBundle.length).toBeGreaterThan(0);
18+
expect(subjectBundle).not.toContain('tslib_1__default');
19+
});

packages/browser/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
},
5050
"devDependencies": {
5151
"@sentry-internal/integration-shims": "8.18.0",
52-
"fake-indexeddb": "^4.0.1",
53-
"webpack": "^4.47.0"
52+
"fake-indexeddb": "^6.0.0"
5453
},
5554
"scripts": {
5655
"build": "run-p build:transpile build:bundle build:types",

packages/browser/test/package/npm-build.js

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)