File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed
packages/browser/test/integration Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -400,25 +400,6 @@ describe('integration', function() {
400
400
) ;
401
401
} ) ;
402
402
403
- it ( 'should NOT catch an exception already caught via Sentry.wrap' , function ( done ) {
404
- var iframe = this . iframe ;
405
-
406
- iframeExecute (
407
- iframe ,
408
- done ,
409
- function ( ) {
410
- setTimeout ( done ) ;
411
- Sentry . wrap ( function ( ) {
412
- foo ( ) ;
413
- } ) ( ) ;
414
- } ,
415
- function ( ) {
416
- var sentryData = iframe . contentWindow . sentryData ;
417
- assert . equal ( sentryData . length , 1 ) ; // one caught error
418
- } ,
419
- ) ;
420
- } ) ;
421
-
422
403
it ( 'should NOT catch an exception already caught [but rethrown] via Sentry.captureException' , function ( done ) {
423
404
var iframe = this . iframe ;
424
405
iframeExecute (
@@ -456,6 +437,8 @@ describe('integration', function() {
456
437
div . addEventListener (
457
438
'click' ,
458
439
function ( ) {
440
+ window . element = div ;
441
+ window . context = this ;
459
442
foo ( ) ;
460
443
} ,
461
444
false ,
@@ -465,6 +448,11 @@ describe('integration', function() {
465
448
div . dispatchEvent ( click ) ;
466
449
} ,
467
450
function ( ) {
451
+ // Make sure we preserve the correct context
452
+ assert . equal ( iframe . contentWindow . element , iframe . contentWindow . context ) ;
453
+ delete iframe . contentWindow . element ;
454
+ delete iframe . contentWindow . context ;
455
+
468
456
var sentryData = iframe . contentWindow . sentryData [ 0 ] ;
469
457
assert . isAtLeast ( sentryData . exception . values [ 0 ] . stacktrace . frames . length , 3 ) ;
470
458
assert . isAtMost ( sentryData . exception . values [ 0 ] . stacktrace . frames . length , 5 ) ;
You can’t perform that action at this time.
0 commit comments