File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/core/src/test/shared/telemetry Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,17 @@ describe('TelemetrySpan', function () {
96
96
97
97
describe ( 'TelemetryTracer' , function ( ) {
98
98
let tracer : TelemetryTracer
99
- let clock : ReturnType < typeof installFakeClock >
99
+ let clock : ReturnType < typeof installFakeClock > | undefined
100
100
let sandbox : SinonSandbox
101
101
const metricName = 'test_metric' as MetricName
102
102
103
103
beforeEach ( function ( ) {
104
104
tracer = new TelemetryTracer ( )
105
- clock = installFakeClock ( )
106
105
sandbox = sinon . createSandbox ( )
107
106
} )
108
107
109
108
afterEach ( function ( ) {
110
- clock . uninstall ( )
109
+ clock ? .uninstall ( )
111
110
sandbox . restore ( )
112
111
} )
113
112
@@ -269,11 +268,12 @@ describe('TelemetryTracer', function () {
269
268
} )
270
269
271
270
it ( 'records performance' , function ( ) {
271
+ clock = installFakeClock ( )
272
272
const { expectedCpuUsage, expectedHeapTotal } = stubPerformance ( sandbox )
273
273
tracer . run (
274
274
'function_call' ,
275
275
( ) => {
276
- clock . tick ( 90 )
276
+ clock ? .tick ( 90 )
277
277
} ,
278
278
{
279
279
trackPerformance : true ,
You can’t perform that action at this time.
0 commit comments