Skip to content

Commit 04c3602

Browse files
committed
Fix dedup test and lint
1 parent 270ce53 commit 04c3602

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

packages/core/test/lib/integrations/inboundfilters.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventProcessor, Event } from '@sentry/types';
1+
import { Event,EventProcessor } from '@sentry/types';
22

33
import { InboundFilters, InboundFiltersOptions } from '../../../src/integrations/inboundfilters';
44

packages/integrations/test/dedupe.test.ts

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1+
import { Event } from '@sentry/types';
2+
13
import { _shouldDropEvent } from '../src/dedupe';
24

35
/** JSDoc */
46
function clone<T>(data: T): T {
57
return JSON.parse(JSON.stringify(data));
68
}
79

8-
const messageEvent = {
10+
const messageEvent: Event = {
911
fingerprint: ['MrSnuffles'],
1012
message: 'PickleRick',
11-
stacktrace: {
12-
frames: [
13-
{
14-
colno: 1,
15-
filename: 'filename.js',
16-
function: 'function',
17-
lineno: 1,
18-
},
13+
exception: {
14+
values: [
1915
{
20-
colno: 2,
21-
filename: 'filename.js',
22-
function: 'function',
23-
lineno: 2,
16+
stacktrace: {
17+
frames: [
18+
{
19+
colno: 1,
20+
filename: 'filename.js',
21+
function: 'function',
22+
lineno: 1,
23+
},
24+
{
25+
colno: 2,
26+
filename: 'filename.js',
27+
function: 'function',
28+
lineno: 2,
29+
},
30+
],
31+
},
2432
},
2533
],
2634
},
2735
};
28-
const exceptionEvent = {
36+
const exceptionEvent: Event = {
2937
exception: {
3038
values: [
3139
{
@@ -70,7 +78,7 @@ describe('Dedupe', () => {
7078
it('should not drop if events have same messages, but different stacktraces', () => {
7179
const eventA = clone(messageEvent);
7280
const eventB = clone(messageEvent);
73-
eventB.stacktrace.frames[0].colno = 1337;
81+
eventB.exception.values[0].stacktrace.frames[0].colno = 1337;
7482
expect(_shouldDropEvent(eventA, eventB)).toBe(false);
7583
});
7684

0 commit comments

Comments
 (0)