From 04c3602faf388f8050e7b46055ac727470295e48 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 7 Apr 2022 17:23:52 +0100 Subject: [PATCH] Fix dedup test and lint --- .../lib/integrations/inboundfilters.test.ts | 2 +- packages/integrations/test/dedupe.test.ts | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index ea2790f08921..a637f2370d7f 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -1,4 +1,4 @@ -import { EventProcessor, Event } from '@sentry/types'; +import { Event,EventProcessor } from '@sentry/types'; import { InboundFilters, InboundFiltersOptions } from '../../../src/integrations/inboundfilters'; diff --git a/packages/integrations/test/dedupe.test.ts b/packages/integrations/test/dedupe.test.ts index 46cac4d06320..a814f6ad7c97 100644 --- a/packages/integrations/test/dedupe.test.ts +++ b/packages/integrations/test/dedupe.test.ts @@ -1,3 +1,5 @@ +import { Event } from '@sentry/types'; + import { _shouldDropEvent } from '../src/dedupe'; /** JSDoc */ @@ -5,27 +7,33 @@ function clone(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: [ { @@ -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); });