Skip to content

Commit

Permalink
Fix dedup test and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Apr 7, 2022
1 parent 270ce53 commit 04c3602
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/core/test/lib/integrations/inboundfilters.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventProcessor, Event } from '@sentry/types';
import { Event,EventProcessor } from '@sentry/types';

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

Expand Down
38 changes: 23 additions & 15 deletions packages/integrations/test/dedupe.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
import { Event } from '@sentry/types';

import { _shouldDropEvent } from '../src/dedupe';

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

const messageEvent = {
const messageEvent: Event = {
fingerprint: ['MrSnuffles'],
message: 'PickleRick',
stacktrace: {
frames: [
{
colno: 1,
filename: 'filename.js',
function: 'function',
lineno: 1,
},
exception: {
values: [
{
colno: 2,
filename: 'filename.js',
function: 'function',
lineno: 2,
stacktrace: {
frames: [
{
colno: 1,
filename: 'filename.js',
function: 'function',
lineno: 1,
},
{
colno: 2,
filename: 'filename.js',
function: 'function',
lineno: 2,
},
],
},
},
],
},
};
const exceptionEvent = {
const exceptionEvent: Event = {
exception: {
values: [
{
Expand Down Expand Up @@ -70,7 +78,7 @@ describe('Dedupe', () => {
it('should not drop if events have same messages, but different stacktraces', () => {
const eventA = clone(messageEvent);
const eventB = clone(messageEvent);
eventB.stacktrace.frames[0].colno = 1337;
eventB.exception.values[0].stacktrace.frames[0].colno = 1337;
expect(_shouldDropEvent(eventA, eventB)).toBe(false);
});

Expand Down

0 comments on commit 04c3602

Please sign in to comment.