UNPKG

1.52 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var chai_1 = require("chai");
4var index_1 = require("../index");
5function noopImplementationTests(createTracer) {
6 if (createTracer === void 0) { createTracer = function () { return new index_1.Tracer(); }; }
7 describe('Noop Tracer Implementation', function () {
8 describe('Tracer#inject', function () {
9 it('should handle Spans and SpanContexts', function () {
10 var tracer = createTracer();
11 var span = tracer.startSpan('test_operation');
12 var textCarrier = {};
13 chai_1.expect(function () { tracer.inject(span, index_1.FORMAT_TEXT_MAP, textCarrier); }).to.not.throw(Error);
14 });
15 });
16 describe('Span#finish', function () {
17 it('should return undefined', function () {
18 var tracer = createTracer();
19 var span = tracer.startSpan('test_span');
20 chai_1.expect(span.finish()).to.be.undefined;
21 });
22 });
23 describe('Miscellaneous', function () {
24 describe('Memory usage', function () {
25 it('should not report leaks after setting the global tracer', function () {
26 index_1.initGlobalTracer(createTracer());
27 });
28 });
29 });
30 });
31}
32exports.noopImplementationTests = noopImplementationTests;
33exports.default = noopImplementationTests;
34//# sourceMappingURL=noop_implementation.js.map
\No newline at end of file