Skip to content

Commit

Permalink
fix: VisibilityState type for typescript >4.6 (#3741)
Browse files Browse the repository at this point in the history
Co-authored-by: Nev <[email protected]>
  • Loading branch information
martinkuba and MSNev authored Apr 20, 2023
1 parent 61aae10 commit de354db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ import { InMemoryLogRecordExporter } from './../../../src/export/InMemoryLogReco
const describeDocument =
typeof document === 'object' ? describe : describe.skip;

/**
* VisibilityState has been removed from TypeScript 4.6.0+
*/
type WebVisibilityState = 'visible' | 'hidden';

describeDocument('BatchLogRecordProcessor - web main context', () => {
let visibilityState: VisibilityState = 'visible';
// TODO: change to DocumentVisibilityState when TypeScript is upgraded to 4.6+
let visibilityState: WebVisibilityState = 'visible';
let exporter: LogRecordExporter;
let processor: BatchLogRecordProcessor;
let forceFlushSpy: sinon.SinonStub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const describeDocument =
typeof document === 'object' ? describe : describe.skip;

describeDocument('BatchSpanProcessor - web main context', () => {
// TODO: change to DocumentVisibilityState when TypeScript is upgraded to 4.6+
let visibilityState: WebVisibilityState = 'visible';
let exporter: SpanExporter;
let processor: BatchSpanProcessor;
Expand Down

0 comments on commit de354db

Please sign in to comment.