diff --git a/packages/opentelemetry-api/src/api/context.ts b/packages/opentelemetry-api/src/api/context.ts index b93aabeffc6..1044311b3fe 100644 --- a/packages/opentelemetry-api/src/api/context.ts +++ b/packages/opentelemetry-api/src/api/context.ts @@ -22,7 +22,9 @@ import { const NOOP_CONTEXT_MANAGER = new NoopContextManager(); -const GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for("io.opentelemetry.js.api.context"); +const GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for( + 'io.opentelemetry.js.api.context' +); const API_VERSION = 0; /** @@ -54,18 +56,19 @@ export class ContextAPI { return NOOP_CONTEXT_MANAGER; } - (global as any)[GLOBAL_CONTEXT_MANAGER_API_KEY] = function getTraceApi (version: number) { + (global as any)[GLOBAL_CONTEXT_MANAGER_API_KEY] = function getTraceApi( + version: number + ) { if (version !== API_VERSION) { return NOOP_CONTEXT_MANAGER; } return contextManager; - } + }; return contextManager; } - /** * Get the currently active context */ diff --git a/packages/opentelemetry-api/src/api/metrics.ts b/packages/opentelemetry-api/src/api/metrics.ts index 5db11cbce3b..0659d90e282 100644 --- a/packages/opentelemetry-api/src/api/metrics.ts +++ b/packages/opentelemetry-api/src/api/metrics.ts @@ -18,7 +18,7 @@ import { Meter } from '../metrics/Meter'; import { MeterProvider } from '../metrics/MeterProvider'; import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider'; -const GLOBAL_METRICS_API_KEY = Symbol.for("io.opentelemetry.js.api.metrics"); +const GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); const API_VERSION = 0; /** @@ -48,13 +48,15 @@ export class MetricsAPI { return NOOP_METER_PROVIDER; } - (global as any)[GLOBAL_METRICS_API_KEY] = function getTraceApi (version: number) { + (global as any)[GLOBAL_METRICS_API_KEY] = function getTraceApi( + version: number + ) { if (version !== API_VERSION) { return NOOP_METER_PROVIDER; } return provider; - } + }; return provider; } diff --git a/packages/opentelemetry-api/src/api/propagation.ts b/packages/opentelemetry-api/src/api/propagation.ts index 35fe337e926..a07a66ea15b 100644 --- a/packages/opentelemetry-api/src/api/propagation.ts +++ b/packages/opentelemetry-api/src/api/propagation.ts @@ -23,7 +23,9 @@ import { ContextAPI } from './context'; const contextApi = ContextAPI.getInstance(); -const GLOBAL_PROPAGATION_API_KEY = Symbol.for("io.opentelemetry.js.api.propagation"); +const GLOBAL_PROPAGATION_API_KEY = Symbol.for( + 'io.opentelemetry.js.api.propagation' +); const API_VERSION = 0; /** @@ -55,13 +57,15 @@ export class PropagationAPI { return NOOP_HTTP_TEXT_PROPAGATOR; } - (global as any)[GLOBAL_PROPAGATION_API_KEY] = function getTraceApi (version: number) { + (global as any)[GLOBAL_PROPAGATION_API_KEY] = function getTraceApi( + version: number + ) { if (version !== API_VERSION) { return NOOP_HTTP_TEXT_PROPAGATOR; } return propagator; - } + }; return propagator; } diff --git a/packages/opentelemetry-api/src/api/trace.ts b/packages/opentelemetry-api/src/api/trace.ts index 008bb5b370f..827c1100fcf 100644 --- a/packages/opentelemetry-api/src/api/trace.ts +++ b/packages/opentelemetry-api/src/api/trace.ts @@ -18,7 +18,7 @@ import { NOOP_TRACER_PROVIDER } from '../trace/NoopTracerProvider'; import { TracerProvider } from '../trace/tracer_provider'; import { Tracer } from '../trace/tracer'; -const GLOBAL_TRACE_API_KEY = Symbol.for("io.opentelemetry.js.api.trace"); +const GLOBAL_TRACE_API_KEY = Symbol.for('io.opentelemetry.js.api.trace'); const API_VERSION = 0; /** @@ -48,13 +48,15 @@ export class TraceAPI { return NOOP_TRACER_PROVIDER; } - (global as any)[GLOBAL_TRACE_API_KEY] = function getTraceApi (version: number) { + (global as any)[GLOBAL_TRACE_API_KEY] = function getTraceApi( + version: number + ) { if (version !== API_VERSION) { return NOOP_TRACER_PROVIDER; } return provider; - } + }; return this.getTracerProvider(); } diff --git a/packages/opentelemetry-api/test/api/api.test.ts b/packages/opentelemetry-api/test/api/api.test.ts index adb435426a9..d02453d2528 100644 --- a/packages/opentelemetry-api/test/api/api.test.ts +++ b/packages/opentelemetry-api/test/api/api.test.ts @@ -46,11 +46,11 @@ describe('API', () => { const dummySpan = new NoopSpan(spanContext); beforeEach(() => { - context.disable() + context.disable(); trace.disable(); propagation.disable(); metrics.disable(); - }) + }); it('should not crash', () => { functions.forEach(fn => { diff --git a/packages/opentelemetry-node/test/NodeTracerProvider.test.ts b/packages/opentelemetry-node/test/NodeTracerProvider.test.ts index c10ac94d3c3..d38dda53196 100644 --- a/packages/opentelemetry-node/test/NodeTracerProvider.test.ts +++ b/packages/opentelemetry-node/test/NodeTracerProvider.test.ts @@ -58,7 +58,7 @@ describe('NodeTracerProvider', () => { Object.keys(require.cache).forEach(key => delete require.cache[key]); provider.stop(); contextManager.disable(); - context.disable() + context.disable(); }); describe('constructor', () => { diff --git a/packages/opentelemetry-node/test/registration.test.ts b/packages/opentelemetry-node/test/registration.test.ts index 354c7895634..d3056734707 100644 --- a/packages/opentelemetry-node/test/registration.test.ts +++ b/packages/opentelemetry-node/test/registration.test.ts @@ -14,7 +14,12 @@ * limitations under the License. */ -import { context, NoopHttpTextPropagator, propagation, trace } from '@opentelemetry/api'; +import { + context, + NoopHttpTextPropagator, + propagation, + trace, +} from '@opentelemetry/api'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { NoopContextManager } from '@opentelemetry/context-base'; import { HttpTraceContext } from '@opentelemetry/core'; @@ -23,7 +28,7 @@ import { NodeTracerProvider } from '../src'; describe('API registration', () => { beforeEach(() => { - context.disable() + context.disable(); trace.disable(); propagation.disable(); }); @@ -32,8 +37,12 @@ describe('API registration', () => { const tracerProvider = new NodeTracerProvider(); tracerProvider.register(); - assert.ok(context['_getContextManager']() instanceof AsyncHooksContextManager); - assert.ok(propagation['_getGlobalPropagator']() instanceof HttpTraceContext); + assert.ok( + context['_getContextManager']() instanceof AsyncHooksContextManager + ); + assert.ok( + propagation['_getGlobalPropagator']() instanceof HttpTraceContext + ); assert.ok(trace.getTracerProvider() === tracerProvider); }); @@ -62,7 +71,9 @@ describe('API registration', () => { assert.ok(context['_getContextManager']() instanceof NoopContextManager); - assert.ok(propagation['_getGlobalPropagator']() instanceof HttpTraceContext); + assert.ok( + propagation['_getGlobalPropagator']() instanceof HttpTraceContext + ); assert.ok(trace.getTracerProvider() === tracerProvider); }); @@ -72,9 +83,13 @@ describe('API registration', () => { propagator: null, }); - assert.ok(propagation['_getGlobalPropagator']() instanceof NoopHttpTextPropagator); + assert.ok( + propagation['_getGlobalPropagator']() instanceof NoopHttpTextPropagator + ); - assert.ok(context['_getContextManager']() instanceof AsyncHooksContextManager); + assert.ok( + context['_getContextManager']() instanceof AsyncHooksContextManager + ); assert.ok(trace.getTracerProvider() === tracerProvider); }); }); diff --git a/packages/opentelemetry-plugin-document-load/test/documentLoad.test.ts b/packages/opentelemetry-plugin-document-load/test/documentLoad.test.ts index a7b872afff5..712f562d53d 100644 --- a/packages/opentelemetry-plugin-document-load/test/documentLoad.test.ts +++ b/packages/opentelemetry-plugin-document-load/test/documentLoad.test.ts @@ -229,7 +229,7 @@ describe('DocumentLoad Plugin', () => { }); afterEach(() => { - context.disable() + context.disable(); Object.defineProperty(window.document, 'readyState', { writable: true, value: 'complete', diff --git a/packages/opentelemetry-plugin-express/test/express.test.ts b/packages/opentelemetry-plugin-express/test/express.test.ts index 566e8343b99..c9ce2e902e7 100644 --- a/packages/opentelemetry-plugin-express/test/express.test.ts +++ b/packages/opentelemetry-plugin-express/test/express.test.ts @@ -72,7 +72,7 @@ describe('Express Plugin', () => { afterEach(() => { memoryExporter.reset(); - context.disable() + context.disable(); }); describe('Instrumenting normal get operations', () => { diff --git a/packages/opentelemetry-plugin-grpc/test/grpc.test.ts b/packages/opentelemetry-plugin-grpc/test/grpc.test.ts index b2d1221fa28..c137361b242 100644 --- a/packages/opentelemetry-plugin-grpc/test/grpc.test.ts +++ b/packages/opentelemetry-plugin-grpc/test/grpc.test.ts @@ -312,7 +312,7 @@ describe('GrpcPlugin', () => { }); afterEach(() => { - context.disable() + context.disable(); }); it('should return a plugin', () => { diff --git a/packages/opentelemetry-plugin-http/test/functionals/http-enable.test.ts b/packages/opentelemetry-plugin-http/test/functionals/http-enable.test.ts index 307a005a0f9..10fa530ba34 100644 --- a/packages/opentelemetry-plugin-http/test/functionals/http-enable.test.ts +++ b/packages/opentelemetry-plugin-http/test/functionals/http-enable.test.ts @@ -85,7 +85,7 @@ describe('HttpPlugin', () => { }); afterEach(() => { - context.disable() + context.disable(); }); it('should return a plugin', () => { diff --git a/packages/opentelemetry-plugin-http/test/functionals/http-package.test.ts b/packages/opentelemetry-plugin-http/test/functionals/http-package.test.ts index a9e27e08b11..9b69793d28e 100644 --- a/packages/opentelemetry-plugin-http/test/functionals/http-package.test.ts +++ b/packages/opentelemetry-plugin-http/test/functionals/http-package.test.ts @@ -18,7 +18,10 @@ import { context, SpanKind } from '@opentelemetry/api'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { NoopLogger } from '@opentelemetry/core'; import { NodeTracerProvider } from '@opentelemetry/node'; -import { InMemorySpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; +import { + InMemorySpanExporter, + SimpleSpanProcessor, +} from '@opentelemetry/tracing'; import * as assert from 'assert'; import axios, { AxiosResponse } from 'axios'; import * as got from 'got'; @@ -43,7 +46,7 @@ describe('Packages', () => { }); afterEach(() => { - context.disable() + context.disable(); }); describe('get', () => { const logger = new NoopLogger(); diff --git a/packages/opentelemetry-plugin-http/test/integrations/http-enable.test.ts b/packages/opentelemetry-plugin-http/test/integrations/http-enable.test.ts index 93d8b1c0cd4..8b083785766 100644 --- a/packages/opentelemetry-plugin-http/test/integrations/http-enable.test.ts +++ b/packages/opentelemetry-plugin-http/test/integrations/http-enable.test.ts @@ -48,8 +48,8 @@ describe('HttpPlugin Integration tests', () => { }); afterEach(() => { - context.disable() - }) + context.disable(); + }); describe('enable()', () => { before(function(done) { // mandatory diff --git a/packages/opentelemetry-plugin-https/test/functionals/https-enable.test.ts b/packages/opentelemetry-plugin-https/test/functionals/https-enable.test.ts index 15ee02737d4..5648223fe06 100644 --- a/packages/opentelemetry-plugin-https/test/functionals/https-enable.test.ts +++ b/packages/opentelemetry-plugin-https/test/functionals/https-enable.test.ts @@ -92,7 +92,7 @@ describe('HttpsPlugin', () => { afterEach(() => { contextManager.disable(); - context.disable() + context.disable(); }); it('should return a plugin', () => { diff --git a/packages/opentelemetry-plugin-https/test/functionals/https-package.test.ts b/packages/opentelemetry-plugin-https/test/functionals/https-package.test.ts index 48a2373c4a9..0b6935fe36b 100644 --- a/packages/opentelemetry-plugin-https/test/functionals/https-package.test.ts +++ b/packages/opentelemetry-plugin-https/test/functionals/https-package.test.ts @@ -19,7 +19,10 @@ import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { NoopLogger } from '@opentelemetry/core'; import { NodeTracerProvider } from '@opentelemetry/node'; import { Http } from '@opentelemetry/plugin-http'; -import { InMemorySpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; +import { + InMemorySpanExporter, + SimpleSpanProcessor, +} from '@opentelemetry/tracing'; import * as assert from 'assert'; import axios, { AxiosResponse } from 'axios'; import * as got from 'got'; @@ -47,8 +50,8 @@ describe('Packages', () => { }); afterEach(() => { - context.disable() - }) + context.disable(); + }); describe('get', () => { const logger = new NoopLogger(); diff --git a/packages/opentelemetry-plugin-https/test/integrations/https-enable.test.ts b/packages/opentelemetry-plugin-https/test/integrations/https-enable.test.ts index 67106ac29db..d66ee4ae90a 100644 --- a/packages/opentelemetry-plugin-https/test/integrations/https-enable.test.ts +++ b/packages/opentelemetry-plugin-https/test/integrations/https-enable.test.ts @@ -53,8 +53,8 @@ describe('HttpsPlugin Integration tests', () => { }); afterEach(() => { - context.disable() - }) + context.disable(); + }); describe('enable()', () => { before(function(done) { diff --git a/packages/opentelemetry-plugin-ioredis/test/ioredis.test.ts b/packages/opentelemetry-plugin-ioredis/test/ioredis.test.ts index ef3498d2019..cd406bed979 100644 --- a/packages/opentelemetry-plugin-ioredis/test/ioredis.test.ts +++ b/packages/opentelemetry-plugin-ioredis/test/ioredis.test.ts @@ -63,7 +63,7 @@ describe('ioredis', () => { afterEach(() => { contextManager.disable(); - context.disable() + context.disable(); }); before(function() { diff --git a/packages/opentelemetry-plugin-mongodb/test/mongodb.test.ts b/packages/opentelemetry-plugin-mongodb/test/mongodb.test.ts index 36f70af1a89..93a8f1fe23e 100644 --- a/packages/opentelemetry-plugin-mongodb/test/mongodb.test.ts +++ b/packages/opentelemetry-plugin-mongodb/test/mongodb.test.ts @@ -149,7 +149,7 @@ describe('MongoDBPlugin', () => { afterEach(done => { collection.deleteOne({}, done); contextManager.disable(); - context.disable() + context.disable(); }); after(() => { diff --git a/packages/opentelemetry-plugin-mysql/test/mysql.test.ts b/packages/opentelemetry-plugin-mysql/test/mysql.test.ts index 33fdc6881e8..1e949beb4c5 100644 --- a/packages/opentelemetry-plugin-mysql/test/mysql.test.ts +++ b/packages/opentelemetry-plugin-mysql/test/mysql.test.ts @@ -102,7 +102,7 @@ describe('mysql@2.x', () => { afterEach(done => { contextManager.disable(); - context.disable() + context.disable(); memoryExporter.reset(); plugin.disable(); connection.end(() => { diff --git a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/test/pg-pool.test.ts b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/test/pg-pool.test.ts index 953b7659fbf..12b609055fa 100644 --- a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/test/pg-pool.test.ts +++ b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/test/pg-pool.test.ts @@ -137,7 +137,7 @@ describe('pg-pool@2.x', () => { plugin.disable(); pgPlugin.disable(); contextManager.disable(); - context.disable() + context.disable(); }); it('should return a plugin', () => { diff --git a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/test/pg.test.ts b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/test/pg.test.ts index f2e7b186ce5..f4269752bbd 100644 --- a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/test/pg.test.ts +++ b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/test/pg.test.ts @@ -128,7 +128,7 @@ describe('pg@7.x', () => { memoryExporter.reset(); plugin.disable(); contextManager.disable(); - context.disable() + context.disable(); }); it('should return a plugin', () => { diff --git a/packages/opentelemetry-plugin-redis/test/redis.test.ts b/packages/opentelemetry-plugin-redis/test/redis.test.ts index 543e9208230..04e7e92135b 100644 --- a/packages/opentelemetry-plugin-redis/test/redis.test.ts +++ b/packages/opentelemetry-plugin-redis/test/redis.test.ts @@ -63,7 +63,7 @@ describe('redis@2.x', () => { afterEach(() => { contextManager.disable(); - context.disable() + context.disable(); }); before(function() { diff --git a/packages/opentelemetry-plugin-user-interaction/test/userInteraction.nozone.test.ts b/packages/opentelemetry-plugin-user-interaction/test/userInteraction.nozone.test.ts index 856525e34eb..3ac0fd7a4fd 100644 --- a/packages/opentelemetry-plugin-user-interaction/test/userInteraction.nozone.test.ts +++ b/packages/opentelemetry-plugin-user-interaction/test/userInteraction.nozone.test.ts @@ -51,7 +51,7 @@ describe('UserInteractionPlugin', () => { context.setGlobalContextManager(contextManager); sandbox = sinon.createSandbox(); const fakeXhr = sandbox.useFakeXMLHttpRequest(); - fakeXhr.onCreate = function (xhr: sinon.SinonFakeXMLHttpRequest) { + fakeXhr.onCreate = function(xhr: sinon.SinonFakeXMLHttpRequest) { requests.push(xhr); setTimeout(() => { requests[requests.length - 1].respond( @@ -89,7 +89,7 @@ describe('UserInteractionPlugin', () => { requests = []; sandbox.restore(); exportSpy.restore(); - context.disable() + context.disable(); }); it('should handle task without async operation', () => { @@ -115,10 +115,10 @@ describe('UserInteractionPlugin', () => { it('should handle target without function getAttribute', done => { let callback: Function; const btn: any = { - addEventListener: function (name: string, callbackF: Function) { + addEventListener: function(name: string, callbackF: Function) { callback = callbackF; }, - click: function () { + click: function() { callback(); }, }; @@ -134,14 +134,14 @@ describe('UserInteractionPlugin', () => { it('should not create span when element has attribute disabled', done => { let callback: Function; const btn: any = { - addEventListener: function (name: string, callbackF: Function) { + addEventListener: function(name: string, callbackF: Function) { callback = callbackF; }, - click: function () { + click: function() { callback(); }, - getAttribute: function () { }, - hasAttribute: function (name: string) { + getAttribute: function() {}, + hasAttribute: function(name: string) { return name === 'disabled' ? true : false; }, }; @@ -155,7 +155,7 @@ describe('UserInteractionPlugin', () => { }); it('should not create span when start span fails', done => { - userInteractionPlugin['_tracer'].startSpan = function () { + userInteractionPlugin['_tracer'].startSpan = function() { throw 'foo'; }; @@ -246,17 +246,17 @@ describe('UserInteractionPlugin', () => { fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn1); fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn2); fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn3); sandbox.clock.tick(1000); originalSetTimeout(() => { diff --git a/packages/opentelemetry-plugin-user-interaction/test/userInteraction.test.ts b/packages/opentelemetry-plugin-user-interaction/test/userInteraction.test.ts index eeda1e8e6f0..d5317143531 100644 --- a/packages/opentelemetry-plugin-user-interaction/test/userInteraction.test.ts +++ b/packages/opentelemetry-plugin-user-interaction/test/userInteraction.test.ts @@ -55,7 +55,7 @@ describe('UserInteractionPlugin', () => { sandbox = sinon.createSandbox(); history.pushState({ test: 'testing' }, '', `${location.pathname}`); const fakeXhr = sandbox.useFakeXMLHttpRequest(); - fakeXhr.onCreate = function (xhr: sinon.SinonFakeXMLHttpRequest) { + fakeXhr.onCreate = function(xhr: sinon.SinonFakeXMLHttpRequest) { requests.push(xhr); setTimeout(() => { requests[requests.length - 1].respond( @@ -88,7 +88,7 @@ describe('UserInteractionPlugin', () => { sandbox.restore(); exportSpy.restore(); contextManager.disable(); - context.disable() + context.disable(); }); it('should handle task without async operation', () => { @@ -204,7 +204,7 @@ describe('UserInteractionPlugin', () => { it('should ignore interaction when element is disabled', done => { const btn = createButton(true); let called = false; - const callback = function () { + const callback = function() { called = true; }; fakeInteraction(callback, btn); @@ -225,17 +225,17 @@ describe('UserInteractionPlugin', () => { fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn1); fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn2); fakeInteraction(() => { getData(FILE_URL, () => { sandbox.clock.tick(10); - }).then(() => { }); + }).then(() => {}); }, btn3); sandbox.clock.tick(1000); originalSetTimeout(() => { diff --git a/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts b/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts index cdbf11e658b..52693d840ae 100644 --- a/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts +++ b/packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts @@ -105,7 +105,7 @@ describe('xhr', () => { }); afterEach(() => { - types.context.disable() + types.context.disable(); }); before(() => { diff --git a/packages/opentelemetry-tracing/test/BasicTracerProvider.test.ts b/packages/opentelemetry-tracing/test/BasicTracerProvider.test.ts index ad9950854f6..4b38b090462 100644 --- a/packages/opentelemetry-tracing/test/BasicTracerProvider.test.ts +++ b/packages/opentelemetry-tracing/test/BasicTracerProvider.test.ts @@ -16,14 +16,22 @@ import { Context, context, SpanContext, TraceFlags } from '@opentelemetry/api'; import { ContextManager } from '@opentelemetry/context-base'; -import { ALWAYS_SAMPLER, NEVER_SAMPLER, NoopLogger, NoRecordingSpan, setActiveSpan, setExtractedSpanContext, TraceState } from '@opentelemetry/core'; +import { + ALWAYS_SAMPLER, + NEVER_SAMPLER, + NoopLogger, + NoRecordingSpan, + setActiveSpan, + setExtractedSpanContext, + TraceState, +} from '@opentelemetry/core'; import { Resource } from '@opentelemetry/resources'; import * as assert from 'assert'; import { BasicTracerProvider, Span } from '../src'; describe('BasicTracerProvider', () => { beforeEach(() => { - context.disable() + context.disable(); }); describe('constructor', () => { diff --git a/packages/opentelemetry-web/test/WebTracerProvider.test.ts b/packages/opentelemetry-web/test/WebTracerProvider.test.ts index d3827605778..60007a44796 100644 --- a/packages/opentelemetry-web/test/WebTracerProvider.test.ts +++ b/packages/opentelemetry-web/test/WebTracerProvider.test.ts @@ -31,8 +31,8 @@ class DummyPlugin extends BasePlugin { } moduleName = 'dummy'; - patch() { } - unpatch() { } + patch() {} + unpatch() {} } describe('WebTracerProvider', () => { @@ -48,7 +48,7 @@ describe('WebTracerProvider', () => { afterEach(() => { contextManager.disable(); - context.disable() + context.disable(); }); it('should construct an instance with required only options', () => { @@ -92,7 +92,7 @@ describe('WebTracerProvider', () => { assert.strictEqual( error, 'contextManager should be defined in' + - ' register method not in constructor' + ' register method not in constructor' ); }); @@ -108,7 +108,7 @@ describe('WebTracerProvider', () => { assert.strictEqual( error, 'propagator should be defined in register' + - ' method not in constructor' + ' method not in constructor' ); }); diff --git a/packages/opentelemetry-web/test/registration.test.ts b/packages/opentelemetry-web/test/registration.test.ts index 79adce9bfca..adcee3a94ec 100644 --- a/packages/opentelemetry-web/test/registration.test.ts +++ b/packages/opentelemetry-web/test/registration.test.ts @@ -14,7 +14,12 @@ * limitations under the License. */ -import { context, NoopHttpTextPropagator, propagation, trace } from '@opentelemetry/api'; +import { + context, + NoopHttpTextPropagator, + propagation, + trace, +} from '@opentelemetry/api'; import { NoopContextManager } from '@opentelemetry/context-base'; import { HttpTraceContext } from '@opentelemetry/core'; import * as assert from 'assert'; @@ -22,7 +27,7 @@ import { StackContextManager, WebTracerProvider } from '../src'; describe('API registration', () => { beforeEach(() => { - context.disable() + context.disable(); trace.disable(); propagation.disable(); }); @@ -31,9 +36,10 @@ describe('API registration', () => { const tracerProvider = new WebTracerProvider(); tracerProvider.register(); - assert.ok(context['_getContextManager']() instanceof StackContextManager); - assert.ok(propagation['_getGlobalPropagator']() instanceof HttpTraceContext); + assert.ok( + propagation['_getGlobalPropagator']() instanceof HttpTraceContext + ); assert.ok(trace.getTracerProvider() === tracerProvider); }); @@ -62,7 +68,9 @@ describe('API registration', () => { assert.ok(context['_getContextManager']() instanceof NoopContextManager); - assert.ok(propagation['_getGlobalPropagator']() instanceof HttpTraceContext); + assert.ok( + propagation['_getGlobalPropagator']() instanceof HttpTraceContext + ); assert.ok(trace.getTracerProvider() === tracerProvider); }); @@ -72,7 +80,9 @@ describe('API registration', () => { propagator: null, }); - assert.ok(propagation['_getGlobalPropagator']() instanceof NoopHttpTextPropagator); + assert.ok( + propagation['_getGlobalPropagator']() instanceof NoopHttpTextPropagator + ); assert.ok(context['_getContextManager']() instanceof StackContextManager); assert.ok(trace.getTracerProvider() === tracerProvider);