1
- import { EventProcessor } from '@sentry/types' ;
1
+ import { EventProcessor , Event } from '@sentry/types' ;
2
2
3
3
import { InboundFilters , InboundFiltersOptions } from '../../../src/integrations/inboundfilters' ;
4
4
@@ -52,50 +52,68 @@ function createInboundFiltersEventProcessor(
52
52
53
53
// Fixtures
54
54
55
- const MESSAGE_EVENT = {
55
+ const MESSAGE_EVENT : Event = {
56
56
message : 'captureMessage' ,
57
57
} ;
58
58
59
- const MESSAGE_EVENT_2 = {
59
+ const MESSAGE_EVENT_2 : Event = {
60
60
message : 'captureMessageSomething' ,
61
61
} ;
62
62
63
- const MESSAGE_EVENT_WITH_STACKTRACE = {
63
+ const MESSAGE_EVENT_WITH_STACKTRACE : Event = {
64
64
message : 'wat' ,
65
- stacktrace : {
66
- // Frames are always in the reverse order, as this is how Sentry expect them to come.
67
- // Frame that crashed is the last one, the one from awesome-analytics
68
- frames : [
69
- { filename : 'https://our-side.com/js/bundle.js' } ,
70
- { filename : 'https://our-side.com/js/bundle.js' } ,
71
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
65
+ exception : {
66
+ values : [
67
+ {
68
+ stacktrace : {
69
+ // Frames are always in the reverse order, as this is how Sentry expect them to come.
70
+ // Frame that crashed is the last one, the one from awesome-analytics
71
+ frames : [
72
+ { filename : 'https://our-side.com/js/bundle.js' } ,
73
+ { filename : 'https://our-side.com/js/bundle.js' } ,
74
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
75
+ ] ,
76
+ } ,
77
+ } ,
72
78
] ,
73
79
} ,
74
80
} ;
75
81
76
- const MESSAGE_EVENT_WITH_ANON_LAST_FRAME = {
82
+ const MESSAGE_EVENT_WITH_ANON_LAST_FRAME : Event = {
77
83
message : 'any' ,
78
- stacktrace : {
79
- frames : [
80
- { filename : 'https://our-side.com/js/bundle.js' } ,
81
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
82
- { filename : '<anonymous>' } ,
84
+ exception : {
85
+ values : [
86
+ {
87
+ stacktrace : {
88
+ frames : [
89
+ { filename : 'https://our-side.com/js/bundle.js' } ,
90
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
91
+ { filename : '<anonymous>' } ,
92
+ ] ,
93
+ } ,
94
+ } ,
83
95
] ,
84
96
} ,
85
97
} ;
86
98
87
- const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME = {
99
+ const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME : Event = {
88
100
message : 'any' ,
89
- stacktrace : {
90
- frames : [
91
- { filename : 'https://our-side.com/js/bundle.js' } ,
92
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
93
- { filename : '[native code]' } ,
101
+ exception : {
102
+ values : [
103
+ {
104
+ stacktrace : {
105
+ frames : [
106
+ { filename : 'https://our-side.com/js/bundle.js' } ,
107
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
108
+ { filename : '[native code]' } ,
109
+ ] ,
110
+ } ,
111
+ } ,
94
112
] ,
95
113
} ,
96
114
} ;
97
115
98
- const EXCEPTION_EVENT = {
116
+ const EXCEPTION_EVENT : Event = {
99
117
exception : {
100
118
values : [
101
119
{
@@ -106,7 +124,7 @@ const EXCEPTION_EVENT = {
106
124
} ,
107
125
} ;
108
126
109
- const EXCEPTION_EVENT_WITH_FRAMES = {
127
+ const EXCEPTION_EVENT_WITH_FRAMES : Event = {
110
128
exception : {
111
129
values : [
112
130
{
@@ -124,7 +142,7 @@ const EXCEPTION_EVENT_WITH_FRAMES = {
124
142
} ,
125
143
} ;
126
144
127
- const SENTRY_EVENT = {
145
+ const SENTRY_EVENT : Event = {
128
146
exception : {
129
147
values : [
130
148
{
@@ -135,7 +153,7 @@ const SENTRY_EVENT = {
135
153
} ,
136
154
} ;
137
155
138
- const SCRIPT_ERROR_EVENT = {
156
+ const SCRIPT_ERROR_EVENT : Event = {
139
157
exception : {
140
158
values : [
141
159
{
@@ -146,9 +164,15 @@ const SCRIPT_ERROR_EVENT = {
146
164
} ,
147
165
} ;
148
166
149
- const MALFORMED_EVENT = {
150
- stacktrace : {
151
- frames : undefined ,
167
+ const MALFORMED_EVENT : Event = {
168
+ exception : {
169
+ values : [
170
+ {
171
+ stacktrace : {
172
+ frames : undefined ,
173
+ } ,
174
+ } ,
175
+ ] ,
152
176
} ,
153
177
} ;
154
178
0 commit comments