opentracing
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -34,11 +34,11 @@ "use strict"; | ||
var tracer = _globalTracer || noopTracer; | ||
return tracer.startSpan.apply(this, arguments); | ||
return tracer.startSpan.apply(tracer, arguments); | ||
}; | ||
GlobalTracerDelegate.prototype.inject = function () { | ||
var tracer = _globalTracer || noopTracer; | ||
return tracer.inject.apply(this, arguments); | ||
return tracer.inject.apply(tracer, arguments); | ||
}; | ||
GlobalTracerDelegate.prototype.extract = function () { | ||
var tracer = _globalTracer || noopTracer; | ||
return tracer.extract.apply(this, arguments); | ||
return tracer.extract.apply(tracer, arguments); | ||
}; | ||
@@ -45,0 +45,0 @@ return GlobalTracerDelegate; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chai_1 = require("chai"); | ||
var opentracing = require("../index"); | ||
var span_1 = require("../span"); | ||
var tracer_1 = require("../tracer"); | ||
function opentracingAPITests() { | ||
@@ -47,2 +59,24 @@ describe('Opentracing API', function () { | ||
} | ||
describe('global tracer', function () { | ||
var dummySpan = new span_1.default(); | ||
afterEach(function () { | ||
opentracing.initGlobalTracer(new tracer_1.Tracer()); | ||
}); | ||
it('should use the global tracer', function () { | ||
opentracing.initGlobalTracer(new TestTracer()); | ||
var tracer = opentracing.globalTracer(); | ||
var span = tracer.startSpan('test'); | ||
chai_1.expect(span).to.equal(dummySpan); | ||
}); | ||
var TestTracer = (function (_super) { | ||
__extends(TestTracer, _super); | ||
function TestTracer() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TestTracer.prototype._startSpan = function (name, fields) { | ||
return dummySpan; | ||
}; | ||
return TestTracer; | ||
}(tracer_1.Tracer)); | ||
}); | ||
}); | ||
@@ -49,0 +83,0 @@ describe('Tracer', function () { |
{ | ||
"name": "opentracing", | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"engines": { | ||
"node": ">=0.10" | ||
}, | ||
"licence": "MIT", | ||
@@ -5,0 +8,0 @@ "licenses": [ |
@@ -1,2 +0,2 @@ | ||
[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![NPM Published Version][npm-img]][npm] | ||
[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![NPM Published Version][npm-img]][npm] ![Node Version][node-img] | ||
@@ -137,4 +137,4 @@ # OpenTracing API for JavaScript | ||
```javascript | ||
const apiCompatibilityChecks = require('opentracing/test/api_compatibility.js'); | ||
apiCompatibilityCheck(() => new CustomTracer()); | ||
const { apiCompatibilityChecks } = require('opentracing/lib/test/api_compatibility.js'); | ||
apiCompatibilityChecks(() => new CustomTracer()); | ||
``` | ||
@@ -149,2 +149,3 @@ | ||
[npm-img]: https://badge.fury.io/js/opentracing.svg | ||
[node-img]: http://img.shields.io/node/v/opentracing.svg | ||
[ci]: https://travis-ci.org/opentracing/opentracing-javascript | ||
@@ -151,0 +152,0 @@ [cov]: https://coveralls.io/github/opentracing/opentracing-javascript?branch=master |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
121165
2036
153
0