@@ -24,9 +24,9 @@ describe('raven.parsers', function(){
24
24
var engine = 'mysql' ;
25
25
var parsed = raven . parsers . parseQuery ( query , engine ) ;
26
26
parsed [ 'message' ] . should . equal ( 'SELECT * FROM `something`' ) ;
27
- parsed . should . have . property ( 'sentry.interfaces.Query ' ) ;
28
- parsed [ 'sentry.interfaces.Query ' ] . query . should . equal ( 'SELECT * FROM `something`' ) ;
29
- parsed [ 'sentry.interfaces.Query ' ] . engine . should . equal ( 'mysql' ) ;
27
+ parsed . should . have . property ( 'query ' ) ;
28
+ parsed [ 'query ' ] . query . should . equal ( 'SELECT * FROM `something`' ) ;
29
+ parsed [ 'query ' ] . engine . should . equal ( 'mysql' ) ;
30
30
} ) ;
31
31
} ) ;
32
32
@@ -48,10 +48,10 @@ describe('raven.parsers', function(){
48
48
}
49
49
} ;
50
50
var parsed = raven . parsers . parseRequest ( mockReq ) ;
51
- parsed . should . have . property ( 'sentry.interfaces.Http ' ) ;
52
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
53
- parsed [ 'sentry.interfaces.Http ' ] . env . NODE_ENV . should . equal ( process . env . NODE_ENV ) ;
54
- parsed [ 'sentry.interfaces.Http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
51
+ parsed . should . have . property ( 'http ' ) ;
52
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
53
+ parsed [ 'http ' ] . env . NODE_ENV . should . equal ( process . env . NODE_ENV ) ;
54
+ parsed [ 'http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
55
55
} ) ;
56
56
57
57
describe ( '`headers` detection' , function ( ) {
@@ -67,7 +67,7 @@ describe('raven.parsers', function(){
67
67
68
68
var parsed = raven . parsers . parseRequest ( mockReq ) ;
69
69
70
- parsed [ 'sentry.interfaces.Http ' ] . headers . should . eql ( { foo : 'bar' } ) ;
70
+ parsed [ 'http ' ] . headers . should . eql ( { foo : 'bar' } ) ;
71
71
} ) ;
72
72
73
73
it ( 'should detect headers via `req.header`' , function ( ) {
@@ -82,7 +82,7 @@ describe('raven.parsers', function(){
82
82
83
83
var parsed = raven . parsers . parseRequest ( mockReq ) ;
84
84
85
- parsed [ 'sentry.interfaces.Http ' ] . headers . should . eql ( { foo : 'bar' } ) ;
85
+ parsed [ 'http ' ] . headers . should . eql ( { foo : 'bar' } ) ;
86
86
} ) ;
87
87
} ) ;
88
88
@@ -96,7 +96,7 @@ describe('raven.parsers', function(){
96
96
97
97
var parsed = raven . parsers . parseRequest ( mockReq ) ;
98
98
99
- parsed [ 'sentry.interfaces.Http ' ] . method . should . equal ( 'GET' ) ;
99
+ parsed [ 'http ' ] . method . should . equal ( 'GET' ) ;
100
100
} ) ;
101
101
} ) ;
102
102
@@ -110,7 +110,7 @@ describe('raven.parsers', function(){
110
110
111
111
var parsed = raven . parsers . parseRequest ( mockReq ) ;
112
112
113
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
113
+ parsed [ 'http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
114
114
} ) ;
115
115
116
116
it ( 'should detect host via `req.header.host`' , function ( ) {
@@ -124,7 +124,7 @@ describe('raven.parsers', function(){
124
124
125
125
var parsed = raven . parsers . parseRequest ( mockReq ) ;
126
126
127
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
127
+ parsed [ 'http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
128
128
} ) ;
129
129
130
130
it ( 'should detect host via `req.headers.host`' , function ( ) {
@@ -138,7 +138,7 @@ describe('raven.parsers', function(){
138
138
139
139
var parsed = raven . parsers . parseRequest ( mockReq ) ;
140
140
141
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
141
+ parsed [ 'http ' ] . url . should . equal ( 'http://mattrobenolt.com/some/path?key=value' ) ;
142
142
} ) ;
143
143
144
144
it ( 'should fallback to <no host> if host is not available' , function ( ) {
@@ -149,7 +149,7 @@ describe('raven.parsers', function(){
149
149
150
150
var parsed = raven . parsers . parseRequest ( mockReq ) ;
151
151
152
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'http://<no host>/some/path?key=value' ) ;
152
+ parsed [ 'http ' ] . url . should . equal ( 'http://<no host>/some/path?key=value' ) ;
153
153
} ) ;
154
154
} ) ;
155
155
@@ -169,7 +169,7 @@ describe('raven.parsers', function(){
169
169
170
170
var parsed = raven . parsers . parseRequest ( mockReq ) ;
171
171
172
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
172
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
173
173
} ) ;
174
174
175
175
it ( 'should detect protocol via `req.secure`' , function ( ) {
@@ -187,7 +187,7 @@ describe('raven.parsers', function(){
187
187
188
188
var parsed = raven . parsers . parseRequest ( mockReq ) ;
189
189
190
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
190
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
191
191
} ) ;
192
192
193
193
it ( 'should detect protocol via `req.socket.encrypted`' , function ( ) {
@@ -204,7 +204,7 @@ describe('raven.parsers', function(){
204
204
205
205
var parsed = raven . parsers . parseRequest ( mockReq ) ;
206
206
207
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
207
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
208
208
} ) ;
209
209
} ) ;
210
210
@@ -220,7 +220,7 @@ describe('raven.parsers', function(){
220
220
} ;
221
221
222
222
var parsed = raven . parsers . parseRequest ( mockReq ) ;
223
- parsed [ 'sentry.interfaces.Http ' ] . cookies . should . eql ( { foo : 'bar' } ) ;
223
+ parsed [ 'http ' ] . cookies . should . eql ( { foo : 'bar' } ) ;
224
224
} ) ;
225
225
226
226
it ( 'should parse `req.header.cookie`' , function ( ) {
@@ -234,7 +234,7 @@ describe('raven.parsers', function(){
234
234
} ;
235
235
236
236
var parsed = raven . parsers . parseRequest ( mockReq ) ;
237
- parsed [ 'sentry.interfaces.Http ' ] . cookies . should . eql ( { foo : 'bar' } ) ;
237
+ parsed [ 'http ' ] . cookies . should . eql ( { foo : 'bar' } ) ;
238
238
} ) ;
239
239
240
240
} ) ;
@@ -250,7 +250,7 @@ describe('raven.parsers', function(){
250
250
251
251
var parsed = raven . parsers . parseRequest ( mockReq ) ;
252
252
253
- parsed [ 'sentry.interfaces.Http ' ] . query_string . should . eql ( { some : 'key' } ) ;
253
+ parsed [ 'http ' ] . query_string . should . eql ( { some : 'key' } ) ;
254
254
} ) ;
255
255
256
256
it ( 'should detect query via `req.url`' , function ( ) {
@@ -262,7 +262,7 @@ describe('raven.parsers', function(){
262
262
263
263
var parsed = raven . parsers . parseRequest ( mockReq ) ;
264
264
265
- parsed [ 'sentry.interfaces.Http ' ] . query_string . should . eql ( { foo : 'bar' } ) ;
265
+ parsed [ 'http ' ] . query_string . should . eql ( { foo : 'bar' } ) ;
266
266
} ) ;
267
267
} ) ;
268
268
@@ -279,7 +279,7 @@ describe('raven.parsers', function(){
279
279
280
280
var parsed = raven . parsers . parseRequest ( mockReq ) ;
281
281
282
- parsed [ 'sentry.interfaces.Http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
282
+ parsed [ 'http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
283
283
} ) ;
284
284
285
285
it ( 'should detect ip via `req.connection.remoteAddress`' , function ( ) {
@@ -296,7 +296,7 @@ describe('raven.parsers', function(){
296
296
297
297
var parsed = raven . parsers . parseRequest ( mockReq ) ;
298
298
299
- parsed [ 'sentry.interfaces.Http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
299
+ parsed [ 'http ' ] . env . REMOTE_ADDR . should . equal ( '69.69.69.69' ) ;
300
300
} ) ;
301
301
} ) ;
302
302
@@ -311,7 +311,7 @@ describe('raven.parsers', function(){
311
311
312
312
var parsed = raven . parsers . parseRequest ( mockReq ) ;
313
313
314
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
314
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
315
315
} ) ;
316
316
317
317
it ( 'should detect url via `req.url`' , function ( ) {
@@ -324,7 +324,7 @@ describe('raven.parsers', function(){
324
324
325
325
var parsed = raven . parsers . parseRequest ( mockReq ) ;
326
326
327
- parsed [ 'sentry.interfaces.Http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
327
+ parsed [ 'http ' ] . url . should . equal ( 'https://mattrobenolt.com/some/path?key=value' ) ;
328
328
} ) ;
329
329
} ) ;
330
330
@@ -339,7 +339,7 @@ describe('raven.parsers', function(){
339
339
340
340
var parsed = raven . parsers . parseRequest ( mockReq ) ;
341
341
342
- parsed [ 'sentry.interfaces.Http ' ] . data . should . equal ( 'foo=bar' ) ;
342
+ parsed [ 'http ' ] . data . should . equal ( 'foo=bar' ) ;
343
343
} ) ;
344
344
345
345
it ( 'should fallback to <unavailable> if body is not available' , function ( ) {
@@ -352,7 +352,7 @@ describe('raven.parsers', function(){
352
352
353
353
var parsed = raven . parsers . parseRequest ( mockReq ) ;
354
354
355
- parsed [ 'sentry.interfaces.Http ' ] . data . should . equal ( '<unavailable>' ) ;
355
+ parsed [ 'http ' ] . data . should . equal ( '<unavailable>' ) ;
356
356
} ) ;
357
357
} ) ;
358
358
} ) ;
@@ -361,35 +361,32 @@ describe('raven.parsers', function(){
361
361
it ( 'should parse plain Error object' , function ( done ) {
362
362
raven . parsers . parseError ( new Error ( ) , { } , function ( parsed ) {
363
363
parsed [ 'message' ] . should . equal ( 'Error: <no message>' ) ;
364
- parsed . should . have . property ( 'sentry.interfaces.Exception' ) ;
365
- parsed [ 'sentry.interfaces.Exception' ] [ 'type' ] . should . equal ( 'Error' ) ;
366
- parsed [ 'sentry.interfaces.Exception' ] [ 'value' ] . should . equal ( '' ) ;
367
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace' ) ;
368
- parsed [ 'sentry.interfaces.Stacktrace' ] . should . have . property ( 'frames' ) ;
364
+ parsed . should . have . property ( 'exception' ) ;
365
+ parsed [ 'exception' ] [ 0 ] [ 'type' ] . should . equal ( 'Error' ) ;
366
+ parsed [ 'exception' ] [ 0 ] [ 'value' ] . should . equal ( '' ) ;
367
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace' ] . should . have . property ( 'frames' ) ;
369
368
done ( ) ;
370
369
} ) ;
371
370
} ) ;
372
371
373
372
it ( 'should parse Error with message' , function ( done ) {
374
373
raven . parsers . parseError ( new Error ( 'Crap' ) , { } , function ( parsed ) {
375
374
parsed [ 'message' ] . should . equal ( 'Error: Crap' ) ;
376
- parsed . should . have . property ( 'sentry.interfaces.Exception' ) ;
377
- parsed [ 'sentry.interfaces.Exception' ] [ 'type' ] . should . equal ( 'Error' ) ;
378
- parsed [ 'sentry.interfaces.Exception' ] [ 'value' ] . should . equal ( 'Crap' ) ;
379
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace' ) ;
380
- parsed [ 'sentry.interfaces.Stacktrace' ] . should . have . property ( 'frames' ) ;
375
+ parsed . should . have . property ( 'exception' ) ;
376
+ parsed [ 'exception' ] [ 0 ] [ 'type' ] . should . equal ( 'Error' ) ;
377
+ parsed [ 'exception' ] [ 0 ] [ 'value' ] . should . equal ( 'Crap' ) ;
378
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace' ] . should . have . property ( 'frames' ) ;
381
379
done ( ) ;
382
380
} ) ;
383
381
} ) ;
384
382
385
383
it ( 'should parse TypeError with message' , function ( done ) {
386
384
raven . parsers . parseError ( new TypeError ( 'Crap' ) , { } , function ( parsed ) {
387
385
parsed [ 'message' ] . should . equal ( 'TypeError: Crap' ) ;
388
- parsed . should . have . property ( 'sentry.interfaces.Exception' ) ;
389
- parsed [ 'sentry.interfaces.Exception' ] [ 'type' ] . should . equal ( 'TypeError' ) ;
390
- parsed [ 'sentry.interfaces.Exception' ] [ 'value' ] . should . equal ( 'Crap' ) ;
391
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace' ) ;
392
- parsed [ 'sentry.interfaces.Stacktrace' ] . should . have . property ( 'frames' ) ;
386
+ parsed . should . have . property ( 'exception' ) ;
387
+ parsed [ 'exception' ] [ 0 ] [ 'type' ] . should . equal ( 'TypeError' ) ;
388
+ parsed [ 'exception' ] [ 0 ] [ 'value' ] . should . equal ( 'Crap' ) ;
389
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace' ] . should . have . property ( 'frames' ) ;
393
390
done ( ) ;
394
391
} ) ;
395
392
} ) ;
@@ -400,11 +397,10 @@ describe('raven.parsers', function(){
400
397
} catch ( e ) {
401
398
raven . parsers . parseError ( e , { } , function ( parsed ) {
402
399
parsed [ 'message' ] . should . equal ( 'Error: Derp' ) ;
403
- parsed . should . have . property ( 'sentry.interfaces.Exception' ) ;
404
- parsed [ 'sentry.interfaces.Exception' ] [ 'type' ] . should . equal ( 'Error' ) ;
405
- parsed [ 'sentry.interfaces.Exception' ] [ 'value' ] . should . equal ( 'Derp' ) ;
406
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace' ) ;
407
- parsed [ 'sentry.interfaces.Stacktrace' ] . should . have . property ( 'frames' ) ;
400
+ parsed . should . have . property ( 'exception' ) ;
401
+ parsed [ 'exception' ] [ 0 ] [ 'type' ] . should . equal ( 'Error' ) ;
402
+ parsed [ 'exception' ] [ 0 ] [ 'value' ] . should . equal ( 'Derp' ) ;
403
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace' ] . should . have . property ( 'frames' ) ;
408
404
done ( ) ;
409
405
} ) ;
410
406
}
@@ -429,11 +425,10 @@ describe('raven.parsers', function(){
429
425
raven . parsers . parseError ( e , { } , function ( parsed ) {
430
426
parsed [ 'message' ] . should . containEql ( 'TypeError' ) ;
431
427
parsed [ 'message' ] . should . containEql ( 'Derp' ) ;
432
- parsed . should . have . property ( 'sentry.interfaces.Exception' ) ;
433
- parsed [ 'sentry.interfaces.Exception' ] [ 'type' ] . should . equal ( 'TypeError' ) ;
434
- parsed [ 'sentry.interfaces.Exception' ] [ 'value' ] . should . containEql ( 'Derp' ) ;
435
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace' ) ;
436
- parsed [ 'sentry.interfaces.Stacktrace' ] . should . have . property ( 'frames' ) ;
428
+ parsed . should . have . property ( 'exception' ) ;
429
+ parsed [ 'exception' ] [ 0 ] [ 'type' ] . should . equal ( 'TypeError' ) ;
430
+ parsed [ 'exception' ] [ 0 ] [ 'value' ] . should . containEql ( 'Derp' ) ;
431
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace' ] . should . have . property ( 'frames' ) ;
437
432
done ( ) ;
438
433
} ) ;
439
434
}
@@ -444,8 +439,8 @@ describe('raven.parsers', function(){
444
439
assert . strictEqual ( 1 , 2 ) ;
445
440
} catch ( e ) {
446
441
raven . parsers . parseError ( e , { } , function ( parsed ) {
447
- parsed . should . have . property ( 'sentry.interfaces.Stacktrace ' ) ;
448
- parsed [ 'sentry.interfaces.Stacktrace ' ] . should . have . property ( 'frames' ) ;
442
+ parsed . should . have . property ( 'exception ' ) ;
443
+ parsed [ 'exception' ] [ 0 ] [ 'stacktrace '] . should . have . property ( 'frames' ) ;
449
444
parsed . should . have . property ( 'extra' ) ;
450
445
parsed [ 'extra' ] . should . have . property ( 'AssertionError' ) ;
451
446
parsed [ 'extra' ] [ 'AssertionError' ] . should . have . property ( 'actual' ) ;
0 commit comments