File tree 2 files changed +22
-35
lines changed
2 files changed +22
-35
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,28 @@ describe('Hub', () => {
11
11
jest . useRealTimers ( ) ;
12
12
} ) ;
13
13
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
+
14
36
describe ( 'spans' , ( ) => {
15
37
describe ( 'sampling' , ( ) => {
16
38
test ( 'set tracesSampleRate 0 on span' , ( ) => {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments