Comparing version 0.7.1 to 0.7.2
{ | ||
"name": "zipkin", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "The core tracer for zipkin.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -58,2 +58,34 @@ const sinon = require('sinon'); | ||
// Applications can override the span name via trace.recordRpc | ||
it('should record span name as last recordRpc', () => { | ||
const logSpan = sinon.spy(); | ||
const ctxImpl = new ExplicitContext(); | ||
const logger = {logSpan}; | ||
const recorder = new BatchRecorder({logger}); | ||
const trace = new Tracer({ctxImpl, recorder}); | ||
ctxImpl.scoped(() => { | ||
trace.setId(new TraceId({ | ||
traceId: None, | ||
parentId: new Some('a'), | ||
spanId: 'c', | ||
sampled: new Some(true) | ||
})); | ||
trace.recordServiceName('SmoothieStore'); | ||
trace.recordRpc('buySmoothie'); | ||
trace.recordAnnotation(new Annotation.ServerRecv()); | ||
// some customization code scoped to this trace ID resets the span name | ||
trace.recordRpc('rentSmoothie'); | ||
trace.recordAnnotation(new Annotation.ServerSend()); | ||
const loggedSpan = logSpan.getCall(0).args[0]; | ||
expect(loggedSpan.name).to.eql(new Some('rentSmoothie')); | ||
}); | ||
}); | ||
it('should set MutableSpan.startTimestamp to first record', () => { | ||
@@ -60,0 +92,0 @@ const clock = lolex.install(12345678); |
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
155828
3867