Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Remove noops and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Apr 29, 2021
1 parent 15b2002 commit b9e2dcc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ export * from './baggage';
export * from './common/Exception';
export * from './common/Time';
export * from './diag';
export * from './propagation/NoopTextMapPropagator';
export * from './propagation/TextMapPropagator';
export * from './trace/attributes';
export * from './trace/Event';
export * from './trace/link_context';
export * from './trace/link';
export * from './trace/NoopTracer';
export * from './trace/NoopTracerProvider';
export * from './trace/ProxyTracer';
export * from './trace/ProxyTracerProvider';
export * from './trace/Sampler';
Expand All @@ -51,7 +48,6 @@ export {
} from './trace/spancontext-utils';

export * from './context/context';
export * from './context/NoopContextManager';
export * from './context/types';

import { ContextAPI } from './api/context';
Expand Down
2 changes: 1 addition & 1 deletion src/trace/ProxyTracerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { TracerProvider } from './tracer_provider';
import { ProxyTracer } from './ProxyTracer';
import { NoopTracerProvider } from './NoopTracerProvider';

export const NOOP_TRACER_PROVIDER = new NoopTracerProvider();
const NOOP_TRACER_PROVIDER = new NoopTracerProvider();

/**
* Tracer provider which provides {@link ProxyTracer}s.
Expand Down
24 changes: 12 additions & 12 deletions test/api/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@

import * as assert from 'assert';
import api, {
TraceFlags,
NoopTracerProvider,
NoopTracer,
SpanOptions,
Span,
context,
trace,
propagation,
TextMapPropagator,
Context,
TextMapSetter,
TextMapGetter,
ROOT_CONTEXT,
defaultTextMapSetter,
defaultTextMapGetter,
defaultTextMapSetter,
diag,
propagation,
ROOT_CONTEXT,
Span,
SpanOptions,
TextMapGetter,
TextMapPropagator,
TextMapSetter,
trace,
TraceFlags,
} from '../../src';
import { DiagAPI } from '../../src/api/diag';
import { NonRecordingSpan } from '../../src/trace/NonRecordingSpan';
import { NoopTracer } from '../../src/trace/NoopTracer';
import { NoopTracerProvider } from '../../src/trace/NoopTracerProvider';

// DiagLogger implementation
const diagLoggerFunctions = [
Expand Down
6 changes: 3 additions & 3 deletions test/noop-implementations/noop-tracer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

import * as assert from 'assert';
import {
NoopTracer,
context,
setSpanContext,
SpanContext,
SpanKind,
TraceFlags,
context,
setSpanContext,
} from '../../src';
import { NonRecordingSpan } from '../../src/trace/NonRecordingSpan';
import { NoopTracer } from '../../src/trace/NoopTracer';

describe('NoopTracer', () => {
it('should not crash', () => {
Expand Down
12 changes: 6 additions & 6 deletions test/proxy-implementations/proxy-tracer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
import * as assert from 'assert';
import * as sinon from 'sinon';
import {
ProxyTracerProvider,
SpanKind,
TracerProvider,
ProxyTracer,
Tracer,
Span,
NoopTracer,
ProxyTracerProvider,
ROOT_CONTEXT,
Span,
SpanKind,
SpanOptions,
Tracer,
TracerProvider,
} from '../../src';
import { NonRecordingSpan } from '../../src/trace/NonRecordingSpan';
import { NoopTracer } from '../../src/trace/NoopTracer';

describe('ProxyTracer', () => {
let provider: ProxyTracerProvider;
Expand Down

0 comments on commit b9e2dcc

Please sign in to comment.