From 708afd0e9e4831f117b3f7561d1b13c7709439d6 Mon Sep 17 00:00:00 2001 From: Nev <54870357+MSNev@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:38:46 -0800 Subject: [PATCH] fix: batchspanprocessor.test for TS > 4.6.0 (#3636) --- .../test/browser/export/BatchSpanProcessor.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/opentelemetry-sdk-trace-base/test/browser/export/BatchSpanProcessor.test.ts b/packages/opentelemetry-sdk-trace-base/test/browser/export/BatchSpanProcessor.test.ts index c4575fde2c..f510d518ff 100644 --- a/packages/opentelemetry-sdk-trace-base/test/browser/export/BatchSpanProcessor.test.ts +++ b/packages/opentelemetry-sdk-trace-base/test/browser/export/BatchSpanProcessor.test.ts @@ -20,11 +20,17 @@ import { SpanExporter } from '../../../src'; import { BatchSpanProcessor } from '../../../src/platform/browser/export/BatchSpanProcessor'; import { TestTracingSpanExporter } from '../../common/export/TestTracingSpanExporter'; +/** + * VisibilityState has been removed from TypeScript 4.6.0+ + * So just defining a simple replacement + */ +type WebVisibilityState = 'visible' | 'hidden'; + const describeDocument = typeof document === 'object' ? describe : describe.skip; describeDocument('BatchSpanProcessor - web main context', () => { - let visibilityState: VisibilityState = 'visible'; + let visibilityState: WebVisibilityState = 'visible'; let exporter: SpanExporter; let processor: BatchSpanProcessor; let forceFlushSpy: sinon.SinonStub;