99 captureException ,
1010 captureMessage ,
1111 configureScope ,
12+ Hub ,
1213 init ,
13- popScope ,
14- pushScope ,
1514 Scope ,
1615 SentryEvent ,
1716} from '../src' ;
@@ -26,19 +25,19 @@ describe('SentryBrowser', () => {
2625 } ) ;
2726
2827 beforeEach ( ( ) => {
29- pushScope ( ) ;
28+ Hub . getGlobal ( ) . pushScope ( ) ;
3029 } ) ;
3130
3231 afterEach ( ( ) => {
33- popScope ( ) ;
32+ Hub . getGlobal ( ) . popScope ( ) ;
3433 } ) ;
3534
3635 describe ( 'getContext() / setContext()' , ( ) => {
3736 it ( 'should store/load extra' , ( ) => {
3837 configureScope ( ( scope : Scope ) => {
3938 scope . setExtra ( 'abc' , { def : [ 1 ] } ) ;
4039 } ) ;
41- expect ( global . __SENTRY__ . stack [ 1 ] . scope . extra ) . to . deep . equal ( {
40+ expect ( global . __SENTRY__ . hub . stack [ 1 ] . scope . extra ) . to . deep . equal ( {
4241 abc : { def : [ 1 ] } ,
4342 } ) ;
4443 } ) ;
@@ -47,7 +46,7 @@ describe('SentryBrowser', () => {
4746 configureScope ( ( scope : Scope ) => {
4847 scope . setTag ( 'abc' , 'def' ) ;
4948 } ) ;
50- expect ( global . __SENTRY__ . stack [ 1 ] . scope . tags ) . to . deep . equal ( {
49+ expect ( global . __SENTRY__ . hub . stack [ 1 ] . scope . tags ) . to . deep . equal ( {
5150 abc : 'def' ,
5251 } ) ;
5352 } ) ;
@@ -56,7 +55,7 @@ describe('SentryBrowser', () => {
5655 configureScope ( ( scope : Scope ) => {
5756 scope . setUser ( { id : 'def' } ) ;
5857 } ) ;
59- expect ( global . __SENTRY__ . stack [ 1 ] . scope . user ) . to . deep . equal ( {
58+ expect ( global . __SENTRY__ . hub . stack [ 1 ] . scope . user ) . to . deep . equal ( {
6059 id : 'def' ,
6160 } ) ;
6261 } ) ;
@@ -76,7 +75,7 @@ describe('SentryBrowser', () => {
7675 } ) ;
7776
7877 it ( 'should record auto breadcrumbs' , done => {
79- pushScope (
78+ Hub . getGlobal ( ) . pushScope (
8079 new BrowserClient ( {
8180 afterSend : ( event : SentryEvent ) => {
8281 expect ( event . breadcrumbs ! ) . to . have . lengthOf ( 3 ) ;
@@ -98,7 +97,7 @@ describe('SentryBrowser', () => {
9897 addBreadcrumb ( { message : 'test2' } ) ;
9998
10099 captureMessage ( 'event' ) ;
101- popScope ( ) ;
100+ Hub . getGlobal ( ) . popScope ( ) ;
102101 } ) ;
103102 } ) ;
104103
@@ -116,7 +115,7 @@ describe('SentryBrowser', () => {
116115 } ) ;
117116
118117 it ( 'should capture an exception' , done => {
119- pushScope (
118+ Hub . getGlobal ( ) . pushScope (
120119 new BrowserClient ( {
121120 afterSend : ( event : SentryEvent ) => {
122121 expect ( event . exception ) . to . not . be . undefined ;
@@ -134,11 +133,11 @@ describe('SentryBrowser', () => {
134133 } catch ( e ) {
135134 captureException ( e ) ;
136135 }
137- popScope ( ) ;
136+ Hub . getGlobal ( ) . popScope ( ) ;
138137 } ) ;
139138
140139 it ( 'should capture a message' , done => {
141- pushScope (
140+ Hub . getGlobal ( ) . pushScope (
142141 new BrowserClient ( {
143142 afterSend : ( event : SentryEvent ) => {
144143 expect ( event . message ) . to . equal ( 'test' ) ;
@@ -149,11 +148,11 @@ describe('SentryBrowser', () => {
149148 } ) ,
150149 ) ;
151150 captureMessage ( 'test' ) ;
152- popScope ( ) ;
151+ Hub . getGlobal ( ) . popScope ( ) ;
153152 } ) ;
154153
155154 it ( 'should capture an event' , done => {
156- pushScope (
155+ Hub . getGlobal ( ) . pushScope (
157156 new BrowserClient ( {
158157 afterSend : ( event : SentryEvent ) => {
159158 expect ( event . message ) . to . equal ( 'test' ) ;
@@ -164,7 +163,7 @@ describe('SentryBrowser', () => {
164163 } ) ,
165164 ) ;
166165 captureEvent ( { message : 'test' } ) ;
167- popScope ( ) ;
166+ Hub . getGlobal ( ) . popScope ( ) ;
168167 } ) ;
169168 } ) ;
170169} ) ;
0 commit comments