File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function pushActivity(name: string, op: string): number | null {
5050
5151/**
5252 * popActivity removes a React activity.
53- * Is a no-op if invalid Tracing integration or invalid activity id .
53+ * Is a no-op if Tracing integration is not valid .
5454 * @param activity id of activity that is being popped
5555 */
5656function popActivity ( activity : number | null ) : void {
@@ -64,11 +64,11 @@ function popActivity(activity: number | null): void {
6464
6565/**
6666 * Obtain a span given an activity id.
67- * Is a no-op if invalid Tracing integration.
67+ * Is a no-op if Tracing integration is not valid .
6868 * @param activity activity id associated with obtained span
6969 */
7070function getActivitySpan ( activity : number | null ) : Span | undefined {
71- if ( globalTracingIntegration === null ) {
71+ if ( activity === null || globalTracingIntegration === null ) {
7272 return undefined ;
7373 }
7474
Original file line number Diff line number Diff line change @@ -4,24 +4,18 @@ import { renderHook } from '@testing-library/react-hooks';
44import * as React from 'react' ;
55
66import { UNKNOWN_COMPONENT , useProfiler , withProfiler } from '../src/profiler' ;
7- /*(
8- for key in SENTRY_FEATURES:
9- SENTRY_FEATURES[key] = True
107
11- SENTRY_APM_SAMPLING = 1
12- )*/
138const TEST_SPAN_ID = '518999beeceb49af' ;
9+ const TEST_TIMESTAMP = '123456' ;
1410
1511const mockStartChild = jest . fn ( ( spanArgs : SpanContext ) => ( { ...spanArgs } ) ) ;
16- const TEST_SPAN = {
17- spanId : TEST_SPAN_ID ,
18- startChild : mockStartChild ,
19- } ;
20- const TEST_TIMESTAMP = '123456' ;
2112const mockPushActivity = jest . fn ( ) . mockReturnValue ( 1 ) ;
2213const mockPopActivity = jest . fn ( ) ;
2314const mockLoggerWarn = jest . fn ( ) ;
24- const mockGetActivitySpan = jest . fn ( ) . mockReturnValue ( TEST_SPAN ) ;
15+ const mockGetActivitySpan = jest . fn ( ) . mockReturnValue ( {
16+ spanId : TEST_SPAN_ID ,
17+ startChild : mockStartChild ,
18+ } ) ;
2519
2620jest . mock ( '@sentry/utils' , ( ) => ( {
2721 logger : {
You can’t perform that action at this time.
0 commit comments