@@ -13,7 +13,7 @@ afterAll(() => {
13
13
*
14
14
* This test nevertheless covers the behavior so that we're aware.
15
15
*/
16
- test ( 'applies withScope scope to thrown error' , done => {
16
+ test ( 'withScope scope is NOT applied to thrown error caught by global handler ' , done => {
17
17
const runner = createRunner ( __dirname , 'server.ts' )
18
18
. ignore ( 'session' , 'sessions' )
19
19
. expect ( {
@@ -49,3 +49,40 @@ test('applies withScope scope to thrown error', done => {
49
49
50
50
expect ( ( ) => runner . makeRequest ( 'get' , '/test/withScope' ) ) . rejects . toThrow ( ) ;
51
51
} ) ;
52
+
53
+ test ( 'isolation scope is applied to thrown error caught by global handler' , done => {
54
+ const runner = createRunner ( __dirname , 'server.ts' )
55
+ . ignore ( 'session' , 'sessions' )
56
+ . expect ( {
57
+ event : {
58
+ exception : {
59
+ values : [
60
+ {
61
+ mechanism : {
62
+ type : 'middleware' ,
63
+ handled : false ,
64
+ } ,
65
+ type : 'Error' ,
66
+ value : 'isolation_test_error' ,
67
+ stacktrace : {
68
+ frames : expect . arrayContaining ( [
69
+ expect . objectContaining ( {
70
+ function : expect . any ( String ) ,
71
+ lineno : expect . any ( Number ) ,
72
+ colno : expect . any ( Number ) ,
73
+ } ) ,
74
+ ] ) ,
75
+ } ,
76
+ } ,
77
+ ] ,
78
+ } ,
79
+ tags : {
80
+ global : 'tag' ,
81
+ 'isolation-scope' : 'tag' ,
82
+ } ,
83
+ } ,
84
+ } )
85
+ . start ( done ) ;
86
+
87
+ expect ( ( ) => runner . makeRequest ( 'get' , '/test/isolationScope' ) ) . rejects . toThrow ( ) ;
88
+ } ) ;
0 commit comments