@@ -380,6 +380,82 @@ describe('globals', function() {
380
380
in_app : false
381
381
} ) ;
382
382
} ) ;
383
+
384
+ it ( 'should mark `in_app` for raven.js' , function ( ) {
385
+ this . sinon . stub ( window , 'extractContextFromFrame' ) . returns ( undefined ) ;
386
+ var frame = {
387
+ url : 'http://lol.com/path/raven.js' ,
388
+ line : 10 ,
389
+ column : 11 ,
390
+ func : 'lol'
391
+ // context: [] context is stubbed
392
+ } ;
393
+
394
+ assert . deepEqual ( normalizeFrame ( frame ) , {
395
+ filename : 'http://lol.com/path/raven.js' ,
396
+ lineno : 10 ,
397
+ colno : 11 ,
398
+ 'function' : 'lol' ,
399
+ in_app : false
400
+ } ) ;
401
+ } ) ;
402
+
403
+ it ( 'should mark `in_app` for raven.min.js' , function ( ) {
404
+ this . sinon . stub ( window , 'extractContextFromFrame' ) . returns ( undefined ) ;
405
+ var frame = {
406
+ url : 'http://lol.com/path/raven.min.js' ,
407
+ line : 10 ,
408
+ column : 11 ,
409
+ func : 'lol'
410
+ // context: [] context is stubbed
411
+ } ;
412
+
413
+ assert . deepEqual ( normalizeFrame ( frame ) , {
414
+ filename : 'http://lol.com/path/raven.min.js' ,
415
+ lineno : 10 ,
416
+ colno : 11 ,
417
+ 'function' : 'lol' ,
418
+ in_app : false
419
+ } ) ;
420
+ } ) ;
421
+
422
+ it ( 'should mark `in_app` for Raven' , function ( ) {
423
+ this . sinon . stub ( window , 'extractContextFromFrame' ) . returns ( undefined ) ;
424
+ var frame = {
425
+ url : 'http://lol.com/path/file.js' ,
426
+ line : 10 ,
427
+ column : 11 ,
428
+ func : 'Raven.wrap'
429
+ // context: [] context is stubbed
430
+ } ;
431
+
432
+ assert . deepEqual ( normalizeFrame ( frame ) , {
433
+ filename : 'http://lol.com/path/file.js' ,
434
+ lineno : 10 ,
435
+ colno : 11 ,
436
+ 'function' : 'Raven.wrap' ,
437
+ in_app : false
438
+ } ) ;
439
+ } ) ;
440
+
441
+ it ( 'should mark `in_app` for TraceKit' , function ( ) {
442
+ this . sinon . stub ( window , 'extractContextFromFrame' ) . returns ( undefined ) ;
443
+ var frame = {
444
+ url : 'http://lol.com/path/file.js' ,
445
+ line : 10 ,
446
+ column : 11 ,
447
+ func : 'TraceKit.lol'
448
+ // context: [] context is stubbed
449
+ } ;
450
+
451
+ assert . deepEqual ( normalizeFrame ( frame ) , {
452
+ filename : 'http://lol.com/path/file.js' ,
453
+ lineno : 10 ,
454
+ colno : 11 ,
455
+ 'function' : 'TraceKit.lol' ,
456
+ in_app : false
457
+ } ) ;
458
+ } ) ;
383
459
} ) ;
384
460
385
461
describe ( 'extractContextFromFrame' , function ( ) {
0 commit comments