File tree Expand file tree Collapse file tree 1 file changed +22
-15
lines changed
packages/integrations/test Expand file tree Collapse file tree 1 file changed +22
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { _shouldDropEvent } from '../src/dedupe' ;
2
+ import { Event } from '@sentry/types' ;
2
3
3
4
/** JSDoc */
4
5
function clone < T > ( data : T ) : T {
5
6
return JSON . parse ( JSON . stringify ( data ) ) ;
6
7
}
7
8
8
- const messageEvent = {
9
+ const messageEvent : Event = {
9
10
fingerprint : [ 'MrSnuffles' ] ,
10
11
message : 'PickleRick' ,
11
- stacktrace : {
12
- frames : [
13
- {
14
- colno : 1 ,
15
- filename : 'filename.js' ,
16
- function : 'function' ,
17
- lineno : 1 ,
18
- } ,
12
+ exception : {
13
+ values : [
19
14
{
20
- colno : 2 ,
21
- filename : 'filename.js' ,
22
- function : 'function' ,
23
- lineno : 2 ,
15
+ stacktrace : {
16
+ frames : [
17
+ {
18
+ colno : 1 ,
19
+ filename : 'filename.js' ,
20
+ function : 'function' ,
21
+ lineno : 1 ,
22
+ } ,
23
+ {
24
+ colno : 2 ,
25
+ filename : 'filename.js' ,
26
+ function : 'function' ,
27
+ lineno : 2 ,
28
+ } ,
29
+ ] ,
30
+ } ,
24
31
} ,
25
32
] ,
26
33
} ,
27
34
} ;
28
- const exceptionEvent = {
35
+ const exceptionEvent : Event = {
29
36
exception : {
30
37
values : [
31
38
{
@@ -70,7 +77,7 @@ describe('Dedupe', () => {
70
77
it ( 'should not drop if events have same messages, but different stacktraces' , ( ) => {
71
78
const eventA = clone ( messageEvent ) ;
72
79
const eventB = clone ( messageEvent ) ;
73
- eventB . stacktrace . frames [ 0 ] . colno = 1337 ;
80
+ eventB . exception . values [ 0 ] . stacktrace . frames [ 0 ] . colno = 1337 ;
74
81
expect ( _shouldDropEvent ( eventA , eventB ) ) . toBe ( false ) ;
75
82
} ) ;
76
83
You can’t perform that action at this time.
0 commit comments