Skip to content

Commit 6d719e1

Browse files
committed
[v7] Fix integrations, eventbuilders, scope, utils and transport-base tests
1 parent 077f5bc commit 6d719e1

File tree

38 files changed

+1561
-1918
lines changed

38 files changed

+1561
-1918
lines changed

packages/eventbuilder-browser/test/parsers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareFramesForEvent } from '../src/parsers';
44

55
describe('Parsers', () => {
66
describe('prepareFramesForEvent()', () => {
7-
describe('removed top frame if its internally reserved word (public API)', async () => {
7+
describe('removed top frame if its internally reserved word (public API)', () => {
88
it('reserved captureException', () => {
99
const stack = [
1010
{ context: ['x'], column: 1, line: 4, url: 'anything.js', func: 'captureException', args: [] },
@@ -36,7 +36,7 @@ describe('Parsers', () => {
3636
});
3737
});
3838

39-
describe('removed bottom frame if its internally reserved word (internal API)', async () => {
39+
describe('removed bottom frame if its internally reserved word (internal API)', () => {
4040
it('reserved sentryWrapped', () => {
4141
const stack = [
4242
{ context: ['x'], column: 1, line: 3, url: 'anything.js', func: 'foo', args: [] },

packages/eventbuilder-node/test/parsers.test.ts

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
// TODO: Rework these tests once implementations are completed.
2-
describe('BreadcrumbsIntegartion', () => {
3-
test('should work', () => {
4-
expect(2 + 2).toEqual(4);
5-
});
6-
});
1+
test.todo('integration-browser-breadcrumbs');
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
// TODO: Rework these tests once implementations are completed.
2-
describe('GlobalHandlers', () => {
3-
test('should work', () => {
4-
expect(2 + 2).toEqual(4);
5-
});
6-
});
1+
test.todo('integration-browser-globalhandlers');

packages/integration-browser-linkederrors/src/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ export class LinkedErrors implements Integration {
1414
}
1515

1616
public install(client: ClientLike): void {
17-
client.addEventProcessor((event: SentryEvent, hint?: EventHint) => {
18-
if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
19-
return event;
20-
}
21-
const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);
22-
event.exception.values = [...linkedErrors, ...event.exception.values];
17+
client.addEventProcessor((event: SentryEvent, hint?: EventHint) => this.process(event, hint));
18+
}
19+
20+
public process(event: SentryEvent, hint?: EventHint): SentryEvent {
21+
if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
2322
return event;
24-
});
23+
}
24+
const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);
25+
event.exception.values = [...linkedErrors, ...event.exception.values];
26+
return event;
2527
}
2628

2729
private _walkErrorTree(error: ExtendedError, key: string, stack: Exception[] = []): Exception[] {

0 commit comments

Comments
 (0)