// This currently doesn't behave in a logical way as when the followsFrom // reference is being ignored, the agent will simply automatically associate // span2 with span1, because span1 is a transaction test.skip('#startSpan(name, {references: [followsFrom]})', setup(function (t) { const tracer = new Tracer(getAgent()) const span1 = tracer.startSpan('foo') const references = [ new opentracing.Reference(opentracing.REFERENCE_FOLLOWS_FROM, span1.context()) ] const span2 = tracer.startSpan('bar', { references }) const _span1 = span1.context()._context const _span2 = span2.context()._context t.notEqual(_span1.traceId, _span1.traceId) t.notEqual(_span1.id, _span1.id) t.equal(_span2.parentId, undefined) t.equal(_span1.parentId, undefined) t.end() }))
const span2 = tracer.startSpan('bar') // implicit child of span1, because span1 is a transaction const references = [ new opentracing.Reference(opentracing.REFERENCE_FOLLOWS_FROM, span1.context()), new opentracing.Reference(opentracing.REFERENCE_CHILD_OF, span2.context()), new opentracing.Reference(opentracing.REFERENCE_CHILD_OF, span1.context())
reference.type() === opentracing.REFERENCE_FOLLOWS_FROM ) { parentContext = reference.referencedContext();