File tree Expand file tree Collapse file tree 2 files changed +22
-35
lines changed Expand file tree Collapse file tree 2 files changed +22
-35
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,28 @@ describe('Hub', () => {
1111 jest . useRealTimers ( ) ;
1212 } ) ;
1313
14+ describe ( 'getTransaction' , ( ) => {
15+ test ( 'simple invoke' , ( ) => {
16+ const hub = new Hub ( new BrowserClient ( { tracesSampleRate : 1 } ) ) ;
17+ const transaction = hub . startTransaction ( { name : 'foo' } ) ;
18+ hub . configureScope ( scope => {
19+ scope . setSpan ( transaction ) ;
20+ } ) ;
21+ hub . configureScope ( s => {
22+ expect ( s . getTransaction ( ) ) . toBe ( transaction ) ;
23+ } ) ;
24+ } ) ;
25+
26+ test ( 'not invoke' , ( ) => {
27+ const hub = new Hub ( new BrowserClient ( { tracesSampleRate : 1 } ) ) ;
28+ const transaction = hub . startTransaction ( { name : 'foo' } ) ;
29+ hub . configureScope ( s => {
30+ expect ( s . getTransaction ( ) ) . toBeUndefined ( ) ;
31+ } ) ;
32+ transaction . finish ( ) ;
33+ } ) ;
34+ } ) ;
35+
1436 describe ( 'spans' , ( ) => {
1537 describe ( 'sampling' , ( ) => {
1638 test ( 'set tracesSampleRate 0 on span' , ( ) => {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments