@@ -50,6 +50,108 @@ function createInboundFiltersEventProcessor(
50
50
return eventProcessors [ 0 ] ;
51
51
}
52
52
53
+ // Fixtures
54
+
55
+ const MESSAGE_EVENT = {
56
+ message : 'captureMessage' ,
57
+ } ;
58
+
59
+ const MESSAGE_EVENT_2 = {
60
+ message : 'captureMessageSomething' ,
61
+ } ;
62
+
63
+ const MESSAGE_EVENT_WITH_STACKTRACE = {
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' } ,
72
+ ] ,
73
+ } ,
74
+ } ;
75
+
76
+ const MESSAGE_EVENT_WITH_ANON_LAST_FRAME = {
77
+ 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>' } ,
83
+ ] ,
84
+ } ,
85
+ } ;
86
+
87
+ const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME = {
88
+ 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]' } ,
94
+ ] ,
95
+ } ,
96
+ } ;
97
+
98
+ const EXCEPTION_EVENT = {
99
+ exception : {
100
+ values : [
101
+ {
102
+ type : 'SyntaxError' ,
103
+ value : 'unidentified ? at line 1337' ,
104
+ } ,
105
+ ] ,
106
+ } ,
107
+ } ;
108
+
109
+ const EXCEPTION_EVENT_WITH_FRAMES = {
110
+ exception : {
111
+ values : [
112
+ {
113
+ stacktrace : {
114
+ // Frames are always in the reverse order, as this is how Sentry expect them to come.
115
+ // Frame that crashed is the last one, the one from awesome-analytics
116
+ frames : [
117
+ { filename : 'https://our-side.com/js/bundle.js' } ,
118
+ { filename : 'https://our-side.com/js/bundle.js' } ,
119
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
120
+ ] ,
121
+ } ,
122
+ } ,
123
+ ] ,
124
+ } ,
125
+ } ;
126
+
127
+ const SENTRY_EVENT = {
128
+ exception : {
129
+ values : [
130
+ {
131
+ type : 'SentryError' ,
132
+ value : 'something something server connection' ,
133
+ } ,
134
+ ] ,
135
+ } ,
136
+ } ;
137
+
138
+ const SCRIPT_ERROR_EVENT = {
139
+ exception : {
140
+ values : [
141
+ {
142
+ type : '[undefined]' ,
143
+ value : 'Script error.' ,
144
+ } ,
145
+ ] ,
146
+ } ,
147
+ } ;
148
+
149
+ const MALFORMED_EVENT = {
150
+ stacktrace : {
151
+ frames : undefined ,
152
+ } ,
153
+ } ;
154
+
53
155
describe ( 'InboundFilters' , ( ) => {
54
156
describe ( '_isSentryError' , ( ) => {
55
157
it ( 'should work as expected' , ( ) => {
@@ -225,105 +327,3 @@ describe('InboundFilters', () => {
225
327
} ) ;
226
328
} ) ;
227
329
} ) ;
228
-
229
- // Fixtures
230
-
231
- const MESSAGE_EVENT = {
232
- message : 'captureMessage' ,
233
- } ;
234
-
235
- const MESSAGE_EVENT_2 = {
236
- message : 'captureMessageSomething' ,
237
- } ;
238
-
239
- const MESSAGE_EVENT_WITH_STACKTRACE = {
240
- message : 'wat' ,
241
- stacktrace : {
242
- // Frames are always in the reverse order, as this is how Sentry expect them to come.
243
- // Frame that crashed is the last one, the one from awesome-analytics
244
- frames : [
245
- { filename : 'https://our-side.com/js/bundle.js' } ,
246
- { filename : 'https://our-side.com/js/bundle.js' } ,
247
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
248
- ] ,
249
- } ,
250
- } ;
251
-
252
- const MESSAGE_EVENT_WITH_ANON_LAST_FRAME = {
253
- message : 'any' ,
254
- stacktrace : {
255
- frames : [
256
- { filename : 'https://our-side.com/js/bundle.js' } ,
257
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
258
- { filename : '<anonymous>' } ,
259
- ] ,
260
- } ,
261
- } ;
262
-
263
- const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME = {
264
- message : 'any' ,
265
- stacktrace : {
266
- frames : [
267
- { filename : 'https://our-side.com/js/bundle.js' } ,
268
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
269
- { filename : '[native code]' } ,
270
- ] ,
271
- } ,
272
- } ;
273
-
274
- const EXCEPTION_EVENT = {
275
- exception : {
276
- values : [
277
- {
278
- type : 'SyntaxError' ,
279
- value : 'unidentified ? at line 1337' ,
280
- } ,
281
- ] ,
282
- } ,
283
- } ;
284
-
285
- const EXCEPTION_EVENT_WITH_FRAMES = {
286
- exception : {
287
- values : [
288
- {
289
- stacktrace : {
290
- // Frames are always in the reverse order, as this is how Sentry expect them to come.
291
- // Frame that crashed is the last one, the one from awesome-analytics
292
- frames : [
293
- { filename : 'https://our-side.com/js/bundle.js' } ,
294
- { filename : 'https://our-side.com/js/bundle.js' } ,
295
- { filename : 'https://awesome-analytics.io/some/file.js' } ,
296
- ] ,
297
- } ,
298
- } ,
299
- ] ,
300
- } ,
301
- } ;
302
-
303
- const SENTRY_EVENT = {
304
- exception : {
305
- values : [
306
- {
307
- type : 'SentryError' ,
308
- value : 'something something server connection' ,
309
- } ,
310
- ] ,
311
- } ,
312
- } ;
313
-
314
- const SCRIPT_ERROR_EVENT = {
315
- exception : {
316
- values : [
317
- {
318
- type : '[undefined]' ,
319
- value : 'Script error.' ,
320
- } ,
321
- ] ,
322
- } ,
323
- } ;
324
-
325
- const MALFORMED_EVENT = {
326
- stacktrace : {
327
- frames : undefined ,
328
- } ,
329
- } ;
0 commit comments